diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index cbf09dab12..dffb324832 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -105,6 +105,7 @@ in the Migration Guide. * [#4723](https://github.com/pmd/pmd/issues/4723): \[cli] Launch fails for "bash pmd" * core * [#1027](https://github.com/pmd/pmd/issues/1027): \[core] Apply the new PropertyDescriptor<Pattern> type where applicable + * [#3903](https://github.com/pmd/pmd/issues/3903): \[core] Consolidate `n.s.pmd.reporting` package * [#4674](https://github.com/pmd/pmd/issues/4674): \[core] WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass * [#4694](https://github.com/pmd/pmd/pull/4694): \[core] Fix line/col numbers in TokenMgrError * [#4717](https://github.com/pmd/pmd/issues/4717): \[core] XSLTRenderer doesn't close report file @@ -152,6 +153,16 @@ in the Migration Guide. #### API Changes +**Moved classes/consolidated packages** + +* pmd-core + * Many types have been moved from the base package `net.sourceforge.pmd` into subpackage {% jdoc_package core::reporting %} + * {%jdoc core::reporting.Report %} + * {%jdoc core::reporting.RuleContext %} + * {%jdoc core::reporting.RuleViolation %} + * {%jdoc core::reporting.ViolationSuppressor %} + * {%jdoc core::reporting.ParametricRuleViolation %} (moved from `net.sourcceforge.pmd.lang.rule`) + **Removed classes and methods** The following previously deprecated classes have been removed: @@ -565,6 +576,7 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7. * [#3815](https://github.com/pmd/pmd/issues/3815): \[core] Update Saxon HE to 10.7 * [#3893](https://github.com/pmd/pmd/pull/3893): \[core] Text documents * [#3902](https://github.com/pmd/pmd/issues/3902): \[core] Violation decorators + * [#3903](https://github.com/pmd/pmd/issues/3903): \[core] Consolidate `n.s.pmd.reporting` package * [#3918](https://github.com/pmd/pmd/issues/3918): \[core] Make LanguageRegistry non static * [#3919](https://github.com/pmd/pmd/issues/3919): \[core] Merge CPD and PMD language * [#3922](https://github.com/pmd/pmd/pull/3922): \[core] Better error reporting for the ruleset parser diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index f02b8a1ff8..cf71d941ff 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -1201,7 +1201,7 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr should be used. - Several members of {% jdoc test::cli.BaseCPDCLITest %} have been deprecated with replacements. - The methods {% jdoc !!core::ant.Formatter#start(java.lang.String) %}, - {% jdoc !!core::ant.Formatter#end(net.sourceforge.pmd.Report) %}, {% jdoc !!core::ant.Formatter#getRenderer() %}, + {% jdoc !!core::ant.Formatter#end(net.sourceforge.pmd.reporting.Report) %}, {% jdoc !!core::ant.Formatter#getRenderer() %}, and {% jdoc !!core::ant.Formatter#isNoOutputSupplied() %} have been internalized. #### 6.45.0 @@ -1211,7 +1211,7 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr * Report has two new methods which allow limited mutations of a given report: * {% jdoc !!core::Report#filterViolations(net.sourceforge.pmd.util.Predicate) %} creates a new report with some violations removed with a given predicate based filter. - * {% jdoc !!core::Report#union(net.sourceforge.pmd.Report) %} can combine two reports into a single new Report. + * {% jdoc !!core::Report#union(net.sourceforge.pmd.reporting.Report) %} can combine two reports into a single new Report. * {% jdoc !!core::util.Predicate %} will be replaced in PMD7 with the standard Predicate interface from java8. * The module `pmd-html` is entirely experimental right now. Anything in the package `net.sourceforge.pmd.lang.html` should be used cautiously. diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java index 199cc2b16b..48296af944 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/Formatter.java @@ -26,7 +26,6 @@ import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.types.Parameter; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.document.TextFile; @@ -36,6 +35,7 @@ import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.FileNameRenderer; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; import net.sourceforge.pmd.reporting.ListenerInitializer; +import net.sourceforge.pmd.reporting.Report; @InternalApi public class Formatter { diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageHandler.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageHandler.java index e1e10d6f00..92348f5f43 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageHandler.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageHandler.java @@ -9,7 +9,6 @@ import static net.sourceforge.pmd.util.CollectionUtil.setOf; import java.util.List; import java.util.Set; -import net.sourceforge.pmd.ViolationSuppressor; import net.sourceforge.pmd.lang.LanguageVersionHandler; import net.sourceforge.pmd.lang.apex.ast.ApexParser; import net.sourceforge.pmd.lang.apex.internal.ApexDesignerBindings; @@ -17,6 +16,7 @@ import net.sourceforge.pmd.lang.apex.metrics.ApexMetrics; import net.sourceforge.pmd.lang.ast.Parser; import net.sourceforge.pmd.lang.metrics.LanguageMetricsProvider; import net.sourceforge.pmd.lang.metrics.Metric; +import net.sourceforge.pmd.reporting.ViolationSuppressor; import net.sourceforge.pmd.util.designerbindings.DesignerBindings; class ApexLanguageHandler implements LanguageVersionHandler { diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexViolationSuppressors.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexViolationSuppressors.java index ef792b2cfb..505a9c3440 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexViolationSuppressors.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexViolationSuppressors.java @@ -13,11 +13,7 @@ import java.util.TreeSet; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.Report.SuppressedViolation; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleViolation; -import net.sourceforge.pmd.ViolationSuppressor; import net.sourceforge.pmd.lang.apex.ast.ASTAnnotation; import net.sourceforge.pmd.lang.apex.ast.ASTAnnotationParameter; import net.sourceforge.pmd.lang.apex.ast.ASTField; @@ -30,6 +26,10 @@ import net.sourceforge.pmd.lang.apex.ast.ASTUserEnum; import net.sourceforge.pmd.lang.apex.ast.ASTVariableDeclarationStatements; import net.sourceforge.pmd.lang.apex.ast.ApexNode; import net.sourceforge.pmd.lang.ast.Node; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.SuppressedViolation; +import net.sourceforge.pmd.reporting.RuleViolation; +import net.sourceforge.pmd.reporting.ViolationSuppressor; final class ApexViolationSuppressors { diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRule.java index c00f59cff9..bdaa957d8e 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRule.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.apex.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.apex.ast.ApexParserVisitor; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractApexRule extends AbstractRule implements ApexParserVisitor { diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/StdCyclomaticComplexityRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/StdCyclomaticComplexityRule.java index 00d876ba19..5e500b8849 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/StdCyclomaticComplexityRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/StdCyclomaticComplexityRule.java @@ -10,7 +10,6 @@ import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty; import java.util.ArrayDeque; import java.util.Deque; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.apex.ast.ASTBooleanExpression; import net.sourceforge.pmd.lang.apex.ast.ASTDoLoopStatement; import net.sourceforge.pmd.lang.apex.ast.ASTForEachStatement; @@ -27,6 +26,7 @@ import net.sourceforge.pmd.lang.apex.ast.ASTWhileLoopStatement; import net.sourceforge.pmd.lang.apex.rule.AbstractApexRule; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java index a4bc0a4e64..48a363aee8 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java @@ -23,7 +23,6 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.apex.ast.ASTAssignmentExpression; import net.sourceforge.pmd.lang.apex.ast.ASTBlockStatement; import net.sourceforge.pmd.lang.apex.ast.ASTDmlDeleteStatement; @@ -57,6 +56,7 @@ import net.sourceforge.pmd.lang.apex.rule.AbstractApexRule; import net.sourceforge.pmd.lang.apex.rule.internal.Helper; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; import com.google.common.base.Objects; import com.google.common.collect.HashMultimap; diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsRule.java index 5bd6ea827d..759e53a10e 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsRule.java @@ -8,7 +8,6 @@ import java.util.Map; import java.util.Optional; import java.util.WeakHashMap; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.apex.ast.ASTDmlDeleteStatement; import net.sourceforge.pmd.lang.apex.ast.ASTDmlInsertStatement; import net.sourceforge.pmd.lang.apex.ast.ASTDmlMergeStatement; @@ -23,6 +22,7 @@ import net.sourceforge.pmd.lang.apex.ast.ASTUserClass; import net.sourceforge.pmd.lang.apex.ast.ApexNode; import net.sourceforge.pmd.lang.apex.rule.AbstractApexRule; import net.sourceforge.pmd.lang.apex.rule.internal.Helper; +import net.sourceforge.pmd.reporting.RuleContext; /** * Finds Apex class that do not define sharing diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/SuppressWarningsTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/SuppressWarningsTest.java index e57c420398..9fff805c89 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/SuppressWarningsTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/SuppressWarningsTest.java @@ -12,11 +12,11 @@ import java.util.List; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.ViolationSuppressor; import net.sourceforge.pmd.lang.apex.ast.ASTUserClass; import net.sourceforge.pmd.lang.apex.ast.ApexParserTestBase; import net.sourceforge.pmd.lang.apex.rule.AbstractApexRule; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.ViolationSuppressor; class SuppressWarningsTest extends ApexParserTestBase { diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRuleTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRuleTest.java index cf2f2c3d6b..56652be2e7 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRuleTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/AbstractApexRuleTest.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.apex.rule; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.lang.apex.ast.ASTAnonymousClass; import net.sourceforge.pmd.lang.apex.ast.ASTUserClass; import net.sourceforge.pmd.lang.apex.ast.ASTUserEnum; @@ -14,6 +13,7 @@ import net.sourceforge.pmd.lang.apex.ast.ASTUserInterface; import net.sourceforge.pmd.lang.apex.ast.ASTUserTrigger; import net.sourceforge.pmd.lang.apex.ast.ApexParserTestBase; import net.sourceforge.pmd.lang.ast.test.TestUtilsKt; +import net.sourceforge.pmd.reporting.Report; class AbstractApexRuleTest extends ApexParserTestBase { diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/ApexXPathRuleTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/ApexXPathRuleTest.java index 09346eb0f7..6878bc1284 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/ApexXPathRuleTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/ApexXPathRuleTest.java @@ -8,10 +8,10 @@ import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.lang.apex.ast.ApexParserTestBase; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.rule.XPathRule; +import net.sourceforge.pmd.reporting.Report; /** * @author daniels diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodTest.java index cda9afc56b..67544fc380 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/design/UnusedMethodTest.java @@ -15,16 +15,16 @@ import org.junit.jupiter.api.io.TempDir; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.RuleSetLoader; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; import net.sourceforge.pmd.lang.apex.ApexLanguageProperties; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; import com.nawforce.pkgforce.path.PathFactory; import com.nawforce.pkgforce.path.PathLike; diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsNestedClassTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsNestedClassTest.java index dd2ae6531b..05c95696c6 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsNestedClassTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/rule/security/ApexSharingViolationsNestedClassTest.java @@ -14,9 +14,9 @@ import java.util.stream.Collectors; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.apex.ast.ApexParserTestBase; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; /** *
Sharing settings are not inherited by inner classes. Sharing settings need to be declared on the class that diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/internal/ProgressBarListener.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/internal/ProgressBarListener.java index 84c43acfca..39debca2d5 100644 --- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/internal/ProgressBarListener.java +++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/internal/ProgressBarListener.java @@ -6,12 +6,12 @@ package net.sourceforge.pmd.cli.internal; import java.util.concurrent.atomic.AtomicInteger; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; import net.sourceforge.pmd.reporting.ListenerInitializer; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; import me.tongfei.progressbar.PmdProgressBarFriend; import me.tongfei.progressbar.ProgressBar; diff --git a/pmd-cli/src/test/java/net/sourceforge/pmd/cli/PmdCliTest.java b/pmd-cli/src/test/java/net/sourceforge/pmd/cli/PmdCliTest.java index be585879ee..744dcaf033 100644 --- a/pmd-cli/src/test/java/net/sourceforge/pmd/cli/PmdCliTest.java +++ b/pmd-cli/src/test/java/net/sourceforge/pmd/cli/PmdCliTest.java @@ -40,11 +40,11 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.internal.Slf4jSimpleConfiguration; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.MockRule; +import net.sourceforge.pmd.reporting.RuleContext; import com.github.stefanbirkner.systemlambda.SystemLambda; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/PmdAnalysis.java b/pmd-core/src/main/java/net/sourceforge/pmd/PmdAnalysis.java index 6a1b013776..8f28d07a38 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/PmdAnalysis.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/PmdAnalysis.java @@ -21,7 +21,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; -import net.sourceforge.pmd.Report.GlobalReportBuilderListener; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimedOperation; import net.sourceforge.pmd.benchmark.TimedOperationCategory; @@ -47,6 +46,8 @@ import net.sourceforge.pmd.reporting.ConfigurableFileNameRenderer; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; import net.sourceforge.pmd.reporting.ListenerInitializer; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.GlobalReportBuilderListener; import net.sourceforge.pmd.reporting.ReportStats; import net.sourceforge.pmd.reporting.ReportStatsListener; import net.sourceforge.pmd.util.AssertionUtil; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/Rule.java b/pmd-core/src/main/java/net/sourceforge/pmd/Rule.java index e6ceb8753e..0c4f37e636 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/Rule.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/Rule.java @@ -16,6 +16,7 @@ import net.sourceforge.pmd.lang.rule.RuleTargetSelector; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; import net.sourceforge.pmd.properties.PropertySource; +import net.sourceforge.pmd.reporting.RuleContext; /** * This is the basic Rule interface for PMD rules. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java index 7a8b7a9498..e21e134325 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java @@ -26,9 +26,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import net.sourceforge.pmd.PMDVersion; -import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.RuleSets; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimedOperation; @@ -39,6 +37,8 @@ import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.reporting.FileAnalysisListener; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.RuleViolation; /** * Abstract implementation of the analysis cache. Handles all operations, except for persistence. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisCache.java index 2b7e0e1b5a..a843b31530 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisCache.java @@ -9,12 +9,12 @@ import java.util.Collection; import java.util.List; import net.sourceforge.pmd.RuleSets; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; +import net.sourceforge.pmd.reporting.RuleViolation; /** * An analysis cache for incremental analysis. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisResult.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisResult.java index 6c87b8e052..956246b80c 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisResult.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisResult.java @@ -7,8 +7,8 @@ package net.sourceforge.pmd.cache; import java.util.ArrayList; import java.util.List; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.annotation.InternalApi; +import net.sourceforge.pmd.reporting.RuleViolation; /** * The result of a single file analysis. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java index f53d56492e..2f5f7aa1d6 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java @@ -15,11 +15,11 @@ import java.util.Map.Entry; import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.FileLocation; import net.sourceforge.pmd.lang.document.TextRange2d; +import net.sourceforge.pmd.reporting.RuleViolation; import net.sourceforge.pmd.util.StringUtil; /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java index b1fcc12ed0..e70f7b1b17 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java @@ -20,13 +20,13 @@ import java.util.stream.Collectors; import net.sourceforge.pmd.PMDVersion; import net.sourceforge.pmd.RuleSets; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimedOperation; import net.sourceforge.pmd.benchmark.TimedOperationCategory; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.TextFile; +import net.sourceforge.pmd.reporting.RuleViolation; /** * An analysis cache backed by a regular file. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/NoopAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/NoopAnalysisCache.java index ea8896501d..737510d83b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/NoopAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/NoopAnalysisCache.java @@ -9,11 +9,11 @@ import java.util.Collections; import java.util.List; import net.sourceforge.pmd.RuleSets; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.reporting.FileAnalysisListener; +import net.sourceforge.pmd.reporting.RuleViolation; /** * A NOOP analysis cache. Easier / safer than null-checking. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java index 3e6d3063a5..f1650cc9a1 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java @@ -7,12 +7,12 @@ package net.sourceforge.pmd.lang; import java.util.Collections; import java.util.List; -import net.sourceforge.pmd.ViolationSuppressor; import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.Parser; import net.sourceforge.pmd.lang.metrics.LanguageMetricsProvider; import net.sourceforge.pmd.lang.rule.xpath.impl.XPathHandler; import net.sourceforge.pmd.reporting.ViolationDecorator; +import net.sourceforge.pmd.reporting.ViolationSuppressor; import net.sourceforge.pmd.util.designerbindings.DesignerBindings; import net.sourceforge.pmd.util.designerbindings.DesignerBindings.DefaultDesignerBindings; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileId.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileId.java index 452ee2ae2e..98da0536da 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileId.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileId.java @@ -11,8 +11,8 @@ import java.nio.file.Paths; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.renderers.Renderer; +import net.sourceforge.pmd.reporting.RuleViolation; /** * An identifier for a {@link TextFile}. This is not a path, but provides diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileLocation.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileLocation.java index e42fe4e212..e9a6d89ab2 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileLocation.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileLocation.java @@ -9,10 +9,10 @@ import java.util.Objects; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.ast.GenericToken; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.reporting.Reportable; +import net.sourceforge.pmd.reporting.RuleViolation; import net.sourceforge.pmd.util.AssertionUtil; /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/PmdRunnable.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/PmdRunnable.java index 8059d94e2b..ff4e71db84 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/PmdRunnable.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/PmdRunnable.java @@ -9,9 +9,7 @@ import static net.sourceforge.pmd.util.CollectionUtil.listOf; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.RuleSets; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimedOperation; import net.sourceforge.pmd.benchmark.TimedOperationCategory; @@ -29,6 +27,8 @@ import net.sourceforge.pmd.lang.ast.SemanticException; import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.reporting.FileAnalysisListener; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; /** * A processing task for a single file. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractDelegateRule.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractDelegateRule.java index a780a65178..a0baeed421 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractDelegateRule.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractDelegateRule.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Map; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RulePriority; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageProcessor; @@ -16,6 +15,7 @@ import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertySource; +import net.sourceforge.pmd.reporting.RuleContext; /** * Base class for Rule implementations which delegate to another Rule instance. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRule.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRule.java index fd0573ed7b..dc6cffc779 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRule.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRule.java @@ -16,7 +16,6 @@ import java.util.Set; import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RulePriority; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageVersion; @@ -24,6 +23,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.properties.AbstractPropertySource; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; /** * Basic abstract implementation of all parser-independent methods of the Rule diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractVisitorRule.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractVisitorRule.java index 9ef6e4a472..f633fe66f5 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractVisitorRule.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractVisitorRule.java @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.AstVisitor; import net.sourceforge.pmd.lang.ast.Node; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractVisitorRule extends AbstractRule { @Override diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/XPathRule.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/XPathRule.java index e5cc2ea252..28bca3fe7b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/XPathRule.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/XPathRule.java @@ -17,7 +17,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.annotation.DeprecatedUntil700; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.ast.Node; @@ -27,6 +26,7 @@ import net.sourceforge.pmd.lang.rule.xpath.internal.DeprecatedAttrLogger; import net.sourceforge.pmd.lang.rule.xpath.internal.SaxonXPathRuleQuery; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleApplicator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleApplicator.java index 6da5e290d8..e468008cf2 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleApplicator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleApplicator.java @@ -11,9 +11,7 @@ import org.apache.commons.lang3.exception.ExceptionContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimedOperation; @@ -23,6 +21,8 @@ import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.reporting.FileAnalysisListener; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.RuleContext; import net.sourceforge.pmd.util.AssertionUtil; import net.sourceforge.pmd.util.StringUtil; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractAccumulatingRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractAccumulatingRenderer.java index 0bf666d9b9..5f90c44b78 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractAccumulatingRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractAccumulatingRenderer.java @@ -7,9 +7,6 @@ package net.sourceforge.pmd.renderers; import java.io.IOException; import java.util.Objects; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.GlobalReportBuilderListener; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimedOperation; @@ -17,6 +14,9 @@ import net.sourceforge.pmd.benchmark.TimedOperationCategory; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.GlobalReportBuilderListener; /** * Abstract base class for {@link Renderer} implementations which only produce diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractIncrementingRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractIncrementingRenderer.java index 05cdc963bb..f1dab29a52 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractIncrementingRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractIncrementingRenderer.java @@ -9,9 +9,9 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.document.TextFile; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; /** * Abstract base class for {@link Renderer} implementations which can produce diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/CSVRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/CSVRenderer.java index dfbd93bcb3..85e869eced 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/CSVRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/CSVRenderer.java @@ -14,11 +14,11 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; import net.sourceforge.pmd.properties.PropertySource; import net.sourceforge.pmd.renderers.ColumnDescriptor.Accessor; +import net.sourceforge.pmd.reporting.RuleViolation; /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/CodeClimateRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/CodeClimateRenderer.java index e2f4334206..737feb6a07 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/CodeClimateRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/CodeClimateRenderer.java @@ -13,8 +13,8 @@ import org.apache.commons.lang3.StringUtils; import net.sourceforge.pmd.PMDVersion; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleViolation; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/EmacsRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/EmacsRenderer.java index 943c34a0ff..2f1a144f0a 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/EmacsRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/EmacsRenderer.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.renderers; import java.io.IOException; import java.util.Iterator; -import net.sourceforge.pmd.RuleViolation; +import net.sourceforge.pmd.reporting.RuleViolation; /** * Renderer to GNU Emacs parsable format. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/EmptyRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/EmptyRenderer.java index 0496e6226c..6161d86604 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/EmptyRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/EmptyRenderer.java @@ -6,8 +6,8 @@ package net.sourceforge.pmd.renderers; import java.io.IOException; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.lang.document.TextFile; +import net.sourceforge.pmd.reporting.Report; /** * An empty renderer, for when you really don't want a report. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/HTMLRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/HTMLRenderer.java index 24e44a4c62..09aeda4144 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/HTMLRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/HTMLRenderer.java @@ -14,13 +14,13 @@ import java.util.Optional; import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.Report.ConfigurationError; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.RuleViolation; /** * Renderer to basic HTML format. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/IDEAJRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/IDEAJRenderer.java index a67103179c..9dd2b7501e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/IDEAJRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/IDEAJRenderer.java @@ -11,9 +11,9 @@ import java.util.Iterator; import java.util.Set; import java.util.StringTokenizer; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleViolation; /** * Renderer for IntelliJ IDEA integration. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/JsonRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/JsonRenderer.java index d793cb7fe7..11ff613259 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/JsonRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/JsonRenderer.java @@ -15,9 +15,9 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; import net.sourceforge.pmd.PMDVersion; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleViolation; -import net.sourceforge.pmd.ViolationSuppressor; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; +import net.sourceforge.pmd.reporting.ViolationSuppressor; import com.google.gson.stream.JsonWriter; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/Renderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/Renderer.java index 443eef1b1d..0a19b46c9a 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/Renderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/Renderer.java @@ -7,13 +7,6 @@ package net.sourceforge.pmd.renderers; import java.io.IOException; import java.io.Writer; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.GlobalReportBuilderListener; -import net.sourceforge.pmd.Report.ProcessingError; -import net.sourceforge.pmd.Report.ReportBuilderListener; -import net.sourceforge.pmd.Report.SuppressedViolation; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimedOperation; @@ -25,6 +18,13 @@ import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.FileNameRenderer; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; import net.sourceforge.pmd.reporting.ListenerInitializer; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.GlobalReportBuilderListener; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.Report.ReportBuilderListener; +import net.sourceforge.pmd.reporting.Report.SuppressedViolation; +import net.sourceforge.pmd.reporting.RuleViolation; /** * This is an interface for rendering a Report. When a Renderer is being diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/SarifRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/SarifRenderer.java index 39cb54baf6..047b6e2ac3 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/SarifRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/SarifRenderer.java @@ -8,11 +8,11 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Iterator; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.renderers.internal.sarif.SarifLog; import net.sourceforge.pmd.renderers.internal.sarif.SarifLogBuilder; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/SummaryHTMLRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/SummaryHTMLRenderer.java index 20272afb30..b552af92d0 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/SummaryHTMLRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/SummaryHTMLRenderer.java @@ -11,8 +11,8 @@ import java.util.Map.Entry; import org.apache.commons.lang3.mutable.MutableInt; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleViolation; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; /** * Renderer to a summarized HTML format. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextColorRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextColorRenderer.java index cb78a79871..d277b62b03 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextColorRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextColorRenderer.java @@ -16,12 +16,12 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.RuleViolation; /** *
diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextPadRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextPadRenderer.java index 0b68d66206..77ced0a1c4 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextPadRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextPadRenderer.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.renderers; import java.io.IOException; import java.util.Iterator; -import net.sourceforge.pmd.RuleViolation; +import net.sourceforge.pmd.reporting.RuleViolation; /** *
diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextRenderer.java
index 04702540fc..4e727c125c 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextRenderer.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextRenderer.java
@@ -7,8 +7,8 @@ package net.sourceforge.pmd.renderers;
import java.io.IOException;
import java.util.Iterator;
-import net.sourceforge.pmd.Report;
-import net.sourceforge.pmd.RuleViolation;
+import net.sourceforge.pmd.reporting.Report;
+import net.sourceforge.pmd.reporting.RuleViolation;
/**
* Renderer to simple text format.
diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/VBHTMLRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/VBHTMLRenderer.java
index ae7a5f7927..2d751aedb4 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/VBHTMLRenderer.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/VBHTMLRenderer.java
@@ -7,8 +7,8 @@ package net.sourceforge.pmd.renderers;
import java.io.IOException;
import java.util.Iterator;
-import net.sourceforge.pmd.Report;
-import net.sourceforge.pmd.RuleViolation;
+import net.sourceforge.pmd.reporting.Report;
+import net.sourceforge.pmd.reporting.RuleViolation;
/**
* Renderer to another HTML format.
diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/XMLRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/XMLRenderer.java
index ef3ac7f0de..7699d26c6c 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/XMLRenderer.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/XMLRenderer.java
@@ -25,11 +25,11 @@ import javax.xml.stream.XMLStreamWriter;
import org.apache.commons.lang3.StringUtils;
import net.sourceforge.pmd.PMDVersion;
-import net.sourceforge.pmd.Report;
-import net.sourceforge.pmd.RuleViolation;
import net.sourceforge.pmd.internal.util.IOUtil;
import net.sourceforge.pmd.properties.PropertyDescriptor;
import net.sourceforge.pmd.properties.PropertyFactory;
+import net.sourceforge.pmd.reporting.Report;
+import net.sourceforge.pmd.reporting.RuleViolation;
import net.sourceforge.pmd.util.StringUtil;
/**
diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/YAHTMLRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/YAHTMLRenderer.java
index db7dcd08ff..9001f5a05c 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/YAHTMLRenderer.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/YAHTMLRenderer.java
@@ -16,10 +16,10 @@ import java.util.TreeMap;
import org.apache.commons.lang3.StringUtils;
-import net.sourceforge.pmd.Report;
-import net.sourceforge.pmd.RuleViolation;
import net.sourceforge.pmd.properties.PropertyDescriptor;
import net.sourceforge.pmd.properties.PropertyFactory;
+import net.sourceforge.pmd.reporting.Report;
+import net.sourceforge.pmd.reporting.RuleViolation;
import net.sourceforge.pmd.util.StringUtil;
/**
diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/internal/sarif/SarifLogBuilder.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/internal/sarif/SarifLogBuilder.java
index d76c021b03..286d247f31 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/internal/sarif/SarifLogBuilder.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/internal/sarif/SarifLogBuilder.java
@@ -11,8 +11,6 @@ import java.util.HashSet;
import java.util.List;
import net.sourceforge.pmd.PMDVersion;
-import net.sourceforge.pmd.Report;
-import net.sourceforge.pmd.RuleViolation;
import net.sourceforge.pmd.renderers.internal.sarif.SarifLog.ArtifactLocation;
import net.sourceforge.pmd.renderers.internal.sarif.SarifLog.AssociatedRule;
import net.sourceforge.pmd.renderers.internal.sarif.SarifLog.Component;
@@ -30,6 +28,8 @@ import net.sourceforge.pmd.renderers.internal.sarif.SarifLog.Run;
import net.sourceforge.pmd.renderers.internal.sarif.SarifLog.Tool;
import net.sourceforge.pmd.renderers.internal.sarif.SarifLog.ToolConfigurationNotification;
import net.sourceforge.pmd.renderers.internal.sarif.SarifLog.ToolExecutionNotification;
+import net.sourceforge.pmd.reporting.Report;
+import net.sourceforge.pmd.reporting.RuleViolation;
public class SarifLogBuilder {
private final List
TODO move {@link net.sourceforge.pmd.Report}, {@link net.sourceforge.pmd.RuleViolation}, - * {@link net.sourceforge.pmd.RuleContext}, {@link net.sourceforge.pmd.ViolationSuppressor} - * into this package */ package net.sourceforge.pmd.reporting; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java index bc82f3452c..3aa0a9df07 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd; -import static net.sourceforge.pmd.ReportTestUtil.getReportForRuleApply; import static net.sourceforge.pmd.properties.NumericConstraints.inRange; +import static net.sourceforge.pmd.reporting.ReportTestUtil.getReportForRuleApply; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -25,10 +25,12 @@ import net.sourceforge.pmd.lang.ast.DummyNode.DummyRootNode; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.rule.AbstractRule; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; import net.sourceforge.pmd.reporting.FileAnalysisListener; +import net.sourceforge.pmd.reporting.ParametricRuleViolation; +import net.sourceforge.pmd.reporting.RuleContext; +import net.sourceforge.pmd.reporting.RuleViolation; class AbstractRuleTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/FooRule.java b/pmd-core/src/test/java/net/sourceforge/pmd/FooRule.java index 540575da39..37c056913a 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/FooRule.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/FooRule.java @@ -12,6 +12,7 @@ import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; import net.sourceforge.pmd.lang.rule.RuleTargetSelector; +import net.sourceforge.pmd.reporting.RuleContext; /** * Sample rule that detect any node with an image of "Foo". Used for testing. diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/PmdAnalysisTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/PmdAnalysisTest.java index 8095c7a009..ae6b321567 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/PmdAnalysisTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/PmdAnalysisTest.java @@ -32,7 +32,9 @@ import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.SimpleTestTextFile; import net.sourceforge.pmd.lang.rule.AbstractRule; import net.sourceforge.pmd.renderers.Renderer; +import net.sourceforge.pmd.reporting.Report; import net.sourceforge.pmd.reporting.ReportStats; +import net.sourceforge.pmd.reporting.RuleContext; import net.sourceforge.pmd.util.log.MessageReporter; /** diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetTest.java index ca94ab2f1f..8787d7b5f6 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetTest.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd; import static net.sourceforge.pmd.PmdCoreTestUtils.dummyLanguage; import static net.sourceforge.pmd.PmdCoreTestUtils.dummyLanguage2; import static net.sourceforge.pmd.PmdCoreTestUtils.dummyVersion; -import static net.sourceforge.pmd.ReportTestUtil.getReportForRuleSetApply; +import static net.sourceforge.pmd.reporting.ReportTestUtil.getReportForRuleSetApply; import static net.sourceforge.pmd.util.CollectionUtil.listOf; import static net.sourceforge.pmd.util.CollectionUtil.setOf; import static org.hamcrest.CoreMatchers.containsString; @@ -40,7 +40,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.RuleSet.RuleSetBuilder; import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.ast.DummyNode.DummyRootNode; @@ -49,6 +48,10 @@ import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.rule.RuleReference; import net.sourceforge.pmd.lang.rule.RuleTargetSelector; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.RuleContext; +import net.sourceforge.pmd.reporting.RuleViolation; class RuleSetTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java index 171219ad1f..597020dad6 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java @@ -37,7 +37,6 @@ import org.mockito.Mockito; import net.sourceforge.pmd.PmdCoreTestUtils; import net.sourceforge.pmd.RuleSets; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.document.FileId; @@ -46,8 +45,9 @@ import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.document.TextFileContent; import net.sourceforge.pmd.lang.document.TextRange2d; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.reporting.FileAnalysisListener; +import net.sourceforge.pmd.reporting.ParametricRuleViolation; +import net.sourceforge.pmd.reporting.RuleViolation; class FileAnalysisCacheTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/DummyLanguageModule.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/DummyLanguageModule.java index b0c76988ae..53b3b48660 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/DummyLanguageModule.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/DummyLanguageModule.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang; import java.util.Objects; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.cpd.CpdCapableLanguage; import net.sourceforge.pmd.cpd.CpdLanguageProperties; import net.sourceforge.pmd.lang.ast.DummyNode; @@ -18,6 +17,7 @@ import net.sourceforge.pmd.lang.document.Chars; import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.document.TextRegion; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; +import net.sourceforge.pmd.reporting.RuleViolation; import net.sourceforge.pmd.reporting.ViolationDecorator; /** diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/AbstractPMDProcessorTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/AbstractPMDProcessorTest.java index ca52a03e65..416db02beb 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/AbstractPMDProcessorTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/AbstractPMDProcessorTest.java @@ -15,10 +15,7 @@ import org.mockito.Mockito; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleSet; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.LanguageVersion; @@ -28,6 +25,9 @@ import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.rule.AbstractRule; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleContext; +import net.sourceforge.pmd.reporting.RuleViolation; import net.sourceforge.pmd.util.log.MessageReporter; abstract class AbstractPMDProcessorTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessorTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessorTest.java index 12e381fac1..5489c0a90b 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessorTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessorTest.java @@ -14,10 +14,10 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; class MultiThreadProcessorTest extends AbstractPMDProcessorTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/MockRule.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/MockRule.java index e3b760674d..e7fb4e797d 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/MockRule.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/MockRule.java @@ -6,11 +6,11 @@ package net.sourceforge.pmd.lang.rule; import static net.sourceforge.pmd.properties.NumericConstraints.inRange; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RulePriority; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/MockRuleWithNoProperties.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/MockRuleWithNoProperties.java index ec4f081756..1105de96fa 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/MockRuleWithNoProperties.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/MockRuleWithNoProperties.java @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RulePriority; import net.sourceforge.pmd.lang.ast.Node; +import net.sourceforge.pmd.reporting.RuleContext; /** diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/XPathRuleTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/XPathRuleTest.java index ccbb20cdb2..b043089952 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/XPathRuleTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/XPathRuleTest.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.rule; import static net.sourceforge.pmd.PmdCoreTestUtils.setDummyLanguage; -import static net.sourceforge.pmd.ReportTestUtil.getReportForRuleApply; +import static net.sourceforge.pmd.reporting.ReportTestUtil.getReportForRuleApply; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasSize; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -15,12 +15,12 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import net.sourceforge.pmd.DummyParsingHelper; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.lang.ast.DummyNode; import net.sourceforge.pmd.lang.ast.DummyNode.DummyRootNode; import net.sourceforge.pmd.lang.ast.DummyNodeWithDeprecatedAttribute; import net.sourceforge.pmd.lang.document.TextRegion; import net.sourceforge.pmd.lang.rule.xpath.XPathVersion; +import net.sourceforge.pmd.reporting.Report; import com.github.stefanbirkner.systemlambda.SystemLambda; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/processor/PmdRunnableTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/processor/PmdRunnableTest.java index 93da9002b1..1cf509b581 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/processor/PmdRunnableTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/processor/PmdRunnableTest.java @@ -26,10 +26,7 @@ import org.slf4j.event.Level; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.internal.SystemProps; import net.sourceforge.pmd.lang.DummyLanguageModule; @@ -41,6 +38,9 @@ import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.RuleContext; import net.sourceforge.pmd.util.ContextedAssertionError; import net.sourceforge.pmd.util.log.MessageReporter; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/AbstractRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/AbstractRendererTest.java index 411be7336a..77dc0c36d7 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/AbstractRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/AbstractRendererTest.java @@ -22,12 +22,8 @@ import org.junit.jupiter.api.io.TempDir; import net.sourceforge.pmd.DummyParsingHelper; import net.sourceforge.pmd.FooRule; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RulePriority; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.RuleWithProperties; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.DummyLanguageModule; @@ -36,9 +32,13 @@ import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.FileLocation; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.document.TextRange2d; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; +import net.sourceforge.pmd.reporting.ParametricRuleViolation; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.RuleViolation; abstract class AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/CSVRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/CSVRendererTest.java index 102d033891..644a3de23e 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/CSVRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/CSVRendererTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd.renderers; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; class CSVRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/CodeClimateRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/CodeClimateRendererTest.java index 0a0b87b385..501e222df9 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/CodeClimateRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/CodeClimateRendererTest.java @@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.document.FileLocation; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.lang.rule.XPathRule; import net.sourceforge.pmd.lang.rule.xpath.XPathVersion; +import net.sourceforge.pmd.reporting.ParametricRuleViolation; class CodeClimateRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/HTMLRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/HTMLRendererTest.java index 6d036898bf..adc1f2cc7d 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/HTMLRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/HTMLRendererTest.java @@ -11,8 +11,8 @@ import java.util.Optional; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; class HTMLRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/JsonRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/JsonRendererTest.java index f696c01c3c..dd5945d36b 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/JsonRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/JsonRendererTest.java @@ -12,10 +12,10 @@ import java.io.IOException; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.FooRule; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; -import net.sourceforge.pmd.Report.SuppressedViolation; -import net.sourceforge.pmd.ViolationSuppressor; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.Report.SuppressedViolation; +import net.sourceforge.pmd.reporting.ViolationSuppressor; class JsonRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/PapariTextRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/PapariTextRendererTest.java index 626e01427c..9b84094ede 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/PapariTextRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/PapariTextRendererTest.java @@ -8,8 +8,8 @@ import java.io.FileNotFoundException; import java.io.Reader; import java.io.StringReader; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; class PapariTextRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SarifRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SarifRendererTest.java index a3b786f8a0..5537c6d055 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SarifRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SarifRendererTest.java @@ -11,9 +11,9 @@ import java.util.function.Consumer; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.reporting.FileAnalysisListener; +import net.sourceforge.pmd.reporting.Report; import com.github.stefanbirkner.systemlambda.SystemLambda; import com.google.gson.Gson; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SummaryHTMLRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SummaryHTMLRendererTest.java index 89a60d00ff..14a4495699 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SummaryHTMLRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SummaryHTMLRendererTest.java @@ -13,11 +13,11 @@ import java.util.function.Consumer; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.FooRule; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.DummyNode.DummyRootNode; import net.sourceforge.pmd.reporting.FileAnalysisListener; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.RuleContext; class SummaryHTMLRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/TextRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/TextRendererTest.java index 5198be9559..72c1d88c8d 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/TextRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/TextRendererTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd.renderers; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; class TextRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/VBHTMLRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/VBHTMLRendererTest.java index 0d473841ac..e3f6f5155b 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/VBHTMLRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/VBHTMLRendererTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd.renderers; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; class VBHTMLRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/XMLRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/XMLRendererTest.java index 482f3508dd..126c72c8f1 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/XMLRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/XMLRendererTest.java @@ -25,15 +25,15 @@ import org.xml.sax.InputSource; import net.sourceforge.pmd.FooRule; import net.sourceforge.pmd.PMDVersion; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.FileLocation; import net.sourceforge.pmd.lang.document.TextRange2d; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; +import net.sourceforge.pmd.reporting.ParametricRuleViolation; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.RuleViolation; import com.github.stefanbirkner.systemlambda.SystemLambda; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/XSLTRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/XSLTRendererTest.java index db22cb95ee..c1499d542b 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/XSLTRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/XSLTRendererTest.java @@ -9,12 +9,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.FooRule; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.FileLocation; import net.sourceforge.pmd.lang.document.TextRange2d; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; +import net.sourceforge.pmd.reporting.ParametricRuleViolation; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; class XSLTRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/YAHTMLRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/YAHTMLRendererTest.java index 414983ad92..5c838f9099 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/YAHTMLRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/YAHTMLRendererTest.java @@ -20,13 +20,13 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import net.sourceforge.pmd.FooRule; -import net.sourceforge.pmd.Report.ConfigurationError; -import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.document.FileLocation; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; +import net.sourceforge.pmd.reporting.ParametricRuleViolation; +import net.sourceforge.pmd.reporting.Report.ConfigurationError; +import net.sourceforge.pmd.reporting.Report.ProcessingError; +import net.sourceforge.pmd.reporting.RuleViolation; import net.sourceforge.pmd.util.CollectionUtil; class YAHTMLRendererTest extends AbstractRendererTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/reporting/GlobalAnalysisListenerTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/GlobalAnalysisListenerTest.java index 71e6fedfc9..a201e8bca9 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/reporting/GlobalAnalysisListenerTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/GlobalAnalysisListenerTest.java @@ -22,7 +22,6 @@ import net.sourceforge.pmd.FooRule; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.cache.AnalysisCache; import net.sourceforge.pmd.cache.NoopAnalysisCache; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/ReportTest.java similarity index 96% rename from pmd-core/src/test/java/net/sourceforge/pmd/ReportTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/reporting/ReportTest.java index b3a10c642d..80b706db49 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/ReportTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.reporting; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; @@ -15,17 +15,15 @@ import java.util.function.Consumer; import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; +import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.FileLocation; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.rule.MockRule; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.renderers.Renderer; import net.sourceforge.pmd.renderers.XMLRenderer; -import net.sourceforge.pmd.reporting.FileAnalysisListener; -import net.sourceforge.pmd.reporting.GlobalAnalysisListener; class ReportTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/ReportTestUtil.java b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/ReportTestUtil.java similarity index 90% rename from pmd-core/src/test/java/net/sourceforge/pmd/ReportTestUtil.java rename to pmd-core/src/test/java/net/sourceforge/pmd/reporting/ReportTestUtil.java index 752d4d580c..c1c4577efd 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/ReportTestUtil.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/ReportTestUtil.java @@ -2,10 +2,13 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.reporting; import java.util.function.BiConsumer; +import net.sourceforge.pmd.Rule; +import net.sourceforge.pmd.RuleSet; +import net.sourceforge.pmd.RuleSets; import net.sourceforge.pmd.lang.LanguageProcessorRegistry; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.RootNode; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleContextTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/RuleContextTest.java similarity index 90% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleContextTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/reporting/RuleContextTest.java index d0e1682f0c..8cd42b3757 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleContextTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/RuleContextTest.java @@ -2,13 +2,14 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.reporting; -import static net.sourceforge.pmd.ReportTestUtil.getReport; +import static net.sourceforge.pmd.reporting.ReportTestUtil.getReport; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; +import net.sourceforge.pmd.FooRule; import net.sourceforge.pmd.lang.ast.DummyNode.DummyRootNode; import net.sourceforge.pmd.lang.ast.impl.DummyTreeUtil; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleViolationComparatorTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/RuleViolationComparatorTest.java similarity index 95% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleViolationComparatorTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/reporting/RuleViolationComparatorTest.java index 8e431d4a7f..04d5b28909 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleViolationComparatorTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/RuleViolationComparatorTest.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.reporting; import static net.sourceforge.pmd.PmdCoreTestUtils.setDummyLanguage; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -16,11 +16,11 @@ import java.util.Random; import org.junit.jupiter.api.Test; +import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.FileLocation; import net.sourceforge.pmd.lang.document.TextRange2d; import net.sourceforge.pmd.lang.rule.MockRule; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; class RuleViolationComparatorTest { @@ -71,7 +71,7 @@ class RuleViolationComparatorTest { } private RuleViolation createJavaRuleViolation(Rule rule, String fileName, int beginLine, String description, - int beginColumn, int endLine, int endColumn) { + int beginColumn, int endLine, int endColumn) { FileLocation loc = FileLocation.range(FileId.fromPathLikeString(fileName), TextRange2d.range2d(beginLine, beginColumn, endLine, endColumn)); return new ParametricRuleViolation(rule, loc, description, Collections.emptyMap()); } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleViolationTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/RuleViolationTest.java similarity index 95% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleViolationTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/reporting/RuleViolationTest.java index 278b888d7e..eaad3c6b6d 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleViolationTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/reporting/RuleViolationTest.java @@ -2,9 +2,9 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd; +package net.sourceforge.pmd.reporting; -import static net.sourceforge.pmd.ReportTest.violation; +import static net.sourceforge.pmd.reporting.ReportTest.violation; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -14,13 +14,14 @@ import java.util.Comparator; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import net.sourceforge.pmd.DummyParsingHelper; +import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.lang.ast.DummyNode; import net.sourceforge.pmd.lang.ast.DummyNode.DummyRootNode; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.FileLocation; import net.sourceforge.pmd.lang.document.TextRange2d; import net.sourceforge.pmd.lang.rule.MockRule; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; class RuleViolationTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/util/FooRuleWithLanguageSetInJava.java b/pmd-core/src/test/java/net/sourceforge/pmd/util/FooRuleWithLanguageSetInJava.java index 38c748645f..ee2b107445 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/util/FooRuleWithLanguageSetInJava.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/util/FooRuleWithLanguageSetInJava.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.util; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; public class FooRuleWithLanguageSetInJava extends AbstractRule { diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/AbstractHtmlRule.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/AbstractHtmlRule.java index 3740d51245..02765e6119 100644 --- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/AbstractHtmlRule.java +++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/AbstractHtmlRule.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.html.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.html.ast.HtmlVisitor; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractHtmlRule extends AbstractRule implements HtmlVisitor { diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeRule.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeRule.java index b24cadff59..b2b692c19c 100644 --- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeRule.java +++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeRule.java @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.html.rule.bestpractices; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.html.ast.ASTHtmlElement; import net.sourceforge.pmd.lang.html.rule.AbstractHtmlRule; +import net.sourceforge.pmd.reporting.RuleContext; public class UnnecessaryTypeAttributeRule extends AbstractHtmlRule { diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesRule.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesRule.java index 3cab721591..a4219abcd4 100644 --- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesRule.java +++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesRule.java @@ -8,10 +8,10 @@ import java.util.Arrays; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.html.ast.ASTHtmlElement; import net.sourceforge.pmd.lang.html.rule.AbstractHtmlRule; import net.sourceforge.pmd.lang.rule.RuleTargetSelector; +import net.sourceforge.pmd.reporting.RuleContext; public class UseAltAttributeForImagesRule extends AbstractHtmlRule { diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/HtmlJavaRuleTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/HtmlJavaRuleTest.java index 9132774ed7..59f0af598c 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/HtmlJavaRuleTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/HtmlJavaRuleTest.java @@ -10,14 +10,14 @@ import java.util.List; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleContext; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.html.ast.ASTHtmlElement; import net.sourceforge.pmd.lang.html.ast.HtmlParsingHelper; import net.sourceforge.pmd.lang.html.rule.AbstractHtmlRule; import net.sourceforge.pmd.lang.rule.xpath.Attribute; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleContext; +import net.sourceforge.pmd.reporting.RuleViolation; class HtmlJavaRuleTest { // from https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.js_props_getter diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/HtmlXPathRuleTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/HtmlXPathRuleTest.java index 22cd8549af..9674718511 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/HtmlXPathRuleTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/HtmlXPathRuleTest.java @@ -10,14 +10,14 @@ import java.util.List; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.html.ast.ASTHtmlComment; import net.sourceforge.pmd.lang.html.ast.ASTHtmlDocument; import net.sourceforge.pmd.lang.html.ast.ASTHtmlTextNode; import net.sourceforge.pmd.lang.html.ast.HtmlParsingHelper; import net.sourceforge.pmd.lang.rule.XPathRule; import net.sourceforge.pmd.lang.rule.xpath.XPathVersion; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; class HtmlXPathRuleTest { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/AnnotationSuppressionUtil.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/AnnotationSuppressionUtil.java index 48dad01c73..8f29f61aa4 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/AnnotationSuppressionUtil.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/AnnotationSuppressionUtil.java @@ -14,11 +14,7 @@ import java.util.Set; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.Report.SuppressedViolation; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleViolation; -import net.sourceforge.pmd.ViolationSuppressor; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTAnnotation; import net.sourceforge.pmd.lang.java.ast.ASTAnyTypeDeclaration; @@ -32,6 +28,10 @@ import net.sourceforge.pmd.lang.java.ast.ASTMethodOrConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.Annotatable; import net.sourceforge.pmd.lang.java.rule.errorprone.ImplicitSwitchFallThroughRule; import net.sourceforge.pmd.lang.java.types.TypeTestUtil; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.Report.SuppressedViolation; +import net.sourceforge.pmd.reporting.RuleViolation; +import net.sourceforge.pmd.reporting.ViolationSuppressor; /** * Helper methods to suppress violations based on annotations. diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/JavaLanguageProcessor.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/JavaLanguageProcessor.java index 020fe79ed0..9fdbfb1f94 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/JavaLanguageProcessor.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/JavaLanguageProcessor.java @@ -11,7 +11,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import net.sourceforge.pmd.ViolationSuppressor; import net.sourceforge.pmd.lang.LanguageVersionHandler; import net.sourceforge.pmd.lang.ast.Parser; import net.sourceforge.pmd.lang.impl.BatchLanguageProcessor; @@ -30,6 +29,7 @@ import net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger.Ve import net.sourceforge.pmd.lang.metrics.LanguageMetricsProvider; import net.sourceforge.pmd.lang.rule.xpath.impl.XPathHandler; import net.sourceforge.pmd.reporting.ViolationDecorator; +import net.sourceforge.pmd.reporting.ViolationSuppressor; import net.sourceforge.pmd.util.designerbindings.DesignerBindings; /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/JavaViolationDecorator.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/JavaViolationDecorator.java index 05900cd459..d6a0ce9bd2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/JavaViolationDecorator.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/internal/JavaViolationDecorator.java @@ -11,7 +11,6 @@ import java.util.stream.Collectors; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTAnyTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTBodyDeclaration; @@ -24,6 +23,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTMethodOrConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclarator; import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId; import net.sourceforge.pmd.lang.java.ast.JavaNode; +import net.sourceforge.pmd.reporting.RuleViolation; import net.sourceforge.pmd.reporting.ViolationDecorator; import net.sourceforge.pmd.util.IteratorUtil; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.java index f230d40b2a..df5911239a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.java.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.JavaParserVisitor; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationRule.java index 2828b0d36a..ee2d2da4b7 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationRule.java @@ -7,11 +7,11 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; import java.util.HashSet; import java.util.Set; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; import net.sourceforge.pmd.lang.java.ast.ASTExplicitConstructorInvocation; import net.sourceforge.pmd.lang.java.ast.JavaNode; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; +import net.sourceforge.pmd.reporting.RuleContext; /** * 1. Note all private constructors. 2. Note all instantiations from outside of diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationRule.java index f73beab33a..f7e0283593 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationRule.java @@ -9,7 +9,6 @@ import java.util.HashSet; import java.util.Objects; import java.util.Set; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTFieldAccess; import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; @@ -22,6 +21,7 @@ import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol; import net.sourceforge.pmd.lang.java.symbols.JMethodSymbol; import net.sourceforge.pmd.lang.java.symbols.JVariableSymbol; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; public class AccessorMethodGenerationRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyRule.java index da45d86c47..ffd8d11790 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyRule.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.java.rule.bestpractices; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType; @@ -18,6 +17,7 @@ import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** * If a method or constructor receives an array as an argument, the array should diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesRule.java index a5a052fd99..870f6a50e7 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesRule.java @@ -9,7 +9,6 @@ import static net.sourceforge.pmd.properties.PropertyFactory.enumProperty; import java.util.Set; import java.util.stream.Collectors; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType; @@ -32,6 +31,7 @@ import net.sourceforge.pmd.lang.java.ast.JavaNode; import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; import net.sourceforge.pmd.util.StringUtil.CaseConvention; public class AvoidReassigningLoopVariablesRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPRule.java index f9e8f8c443..3bafb20156 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPRule.java @@ -14,11 +14,11 @@ import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTStringLiteral; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; public class AvoidUsingHardCodedIPRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementRule.java index b6d38ad82c..dd315c8188 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementRule.java @@ -14,7 +14,6 @@ import java.util.Map; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTArgumentList; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTExpression; @@ -32,6 +31,7 @@ import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.symbols.JVariableSymbol; import net.sourceforge.pmd.lang.java.types.TypeTestUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; /** * Check that log.debug, log.trace, log.error, etc... statements are guarded by diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsRule.java index d97a1afdb9..32c912a88e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsRule.java @@ -12,7 +12,6 @@ import java.util.Set; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; @@ -21,6 +20,7 @@ import net.sourceforge.pmd.lang.java.ast.JavaNode; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol; import net.sourceforge.pmd.lang.java.types.TypeTestUtil; +import net.sourceforge.pmd.reporting.RuleContext; public class LiteralsFirstInComparisonsRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentRule.java index 044e7b9813..ff8680cd09 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentRule.java @@ -12,7 +12,6 @@ import java.util.Set; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.ASTExpressionStatement; import net.sourceforge.pmd.lang.java.ast.ASTForeachStatement; @@ -27,6 +26,7 @@ import net.sourceforge.pmd.lang.java.rule.internal.DataflowPass.DataflowResult; import net.sourceforge.pmd.lang.java.rule.internal.JavaRuleUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; public class UnusedAssignmentRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java index 23506062fe..33f1006d87 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierRule.java @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; import java.util.List; import java.util.regex.Pattern; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTAnnotationTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTAnyTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration; @@ -24,6 +23,7 @@ import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.rule.internal.JavaPropertyUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** * Check for Methods, Fields and Nested Classes that have a default access diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java index c3eb1da6c6..41db736b7a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java @@ -6,11 +6,11 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTForeachStatement; import net.sourceforge.pmd.lang.java.ast.ASTLocalVariableDeclaration; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; public class LocalVariableCouldBeFinalRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java index bd95e874e8..f0fa6d9a2b 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType; @@ -15,6 +14,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTMethodOrConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; public class MethodArgumentCouldBeFinalRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java index 33f56b41b8..fd0e826f2d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java @@ -10,7 +10,6 @@ import java.util.Set; import org.apache.commons.lang3.StringUtils; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTList; @@ -23,6 +22,7 @@ import net.sourceforge.pmd.lang.java.types.OverloadSelectionResult; import net.sourceforge.pmd.lang.java.types.TypePrettyPrint; import net.sourceforge.pmd.lang.java.types.TypeTestUtil; import net.sourceforge.pmd.lang.java.types.ast.ExprContext; +import net.sourceforge.pmd.reporting.RuleContext; /** * diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/DataClassRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/DataClassRule.java index dfbe31b126..79cc433902 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/DataClassRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/DataClassRule.java @@ -9,11 +9,11 @@ import static net.sourceforge.pmd.lang.java.metrics.JavaMetrics.NUMBER_OF_PUBLIC import static net.sourceforge.pmd.lang.java.metrics.JavaMetrics.WEIGHED_METHOD_COUNT; import static net.sourceforge.pmd.lang.java.metrics.JavaMetrics.WEIGHT_OF_CLASS; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTAnyTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.JavaNode; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.metrics.MetricsUtil; +import net.sourceforge.pmd.reporting.RuleContext; import net.sourceforge.pmd.util.StringUtil; /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterRule.java index 5f8d4ccac1..554ea73e8b 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterRule.java @@ -21,7 +21,6 @@ import java.util.stream.Stream; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTArgumentList; import net.sourceforge.pmd.lang.java.ast.ASTArrayAccess; @@ -56,6 +55,7 @@ import net.sourceforge.pmd.lang.java.types.TypeOps; import net.sourceforge.pmd.lang.java.types.TypeTestUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** * This rule can detect possible violations of the Law of Demeter. The Law of diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityRule.java index 565c393e75..0ca5e63da3 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityRule.java @@ -8,7 +8,6 @@ import static net.sourceforge.pmd.properties.NumericConstraints.positive; import java.math.BigInteger; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTMethodOrConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.JavaNode; @@ -18,6 +17,7 @@ import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.metrics.MetricsUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountRule.java index 23c0dbb2a9..5be93f5829 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountRule.java @@ -10,7 +10,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTAnyTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTMethodOrConstructorDeclaration; @@ -23,6 +22,7 @@ import net.sourceforge.pmd.lang.metrics.MetricOptions; import net.sourceforge.pmd.lang.metrics.MetricsUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; import net.sourceforge.pmd.util.AssertionUtil; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsRule.java index ae0a84cd17..300fa40cff 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsRule.java @@ -22,7 +22,6 @@ import java.util.Set; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTBlock; import net.sourceforge.pmd.lang.java.ast.ASTCastExpression; import net.sourceforge.pmd.lang.java.ast.ASTExpression; @@ -36,6 +35,7 @@ import net.sourceforge.pmd.lang.java.ast.JavaNode; import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind; +import net.sourceforge.pmd.reporting.RuleContext; public class SimplifyBooleanReturnsRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java index 63feecfabc..ec354ee05d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java @@ -8,13 +8,13 @@ import static net.sourceforge.pmd.properties.PropertyFactory.regexProperty; import java.util.regex.Pattern; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.document.Chars; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.JavaComment; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; /** * A rule that checks for illegal words in the comment text. diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java index bcaccdfa76..55e128bf44 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java @@ -12,7 +12,6 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTBodyDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration; @@ -28,6 +27,7 @@ import net.sourceforge.pmd.lang.java.rule.internal.JavaRuleUtil; import net.sourceforge.pmd.properties.PropertyBuilder.GenericPropertyBuilder; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; import net.sourceforge.pmd.util.CollectionUtil; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeRule.java index 0786bef786..857d68dc48 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeRule.java @@ -6,13 +6,13 @@ package net.sourceforge.pmd.lang.java.rule.documentation; import static net.sourceforge.pmd.properties.NumericConstraints.positive; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.document.Chars; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.JavaComment; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** * A rule to manage those who just can't shut up... diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandRule.java index c59a86ce1a..5cf8bde053 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandRule.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTAssignmentExpression; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTExpressionStatement; @@ -19,6 +18,7 @@ import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertySource; +import net.sourceforge.pmd.reporting.RuleContext; /** * diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsRule.java index df4f69a9f6..3c76ba8eeb 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsRule.java @@ -18,12 +18,12 @@ import java.util.SortedSet; import java.util.TreeSet; import java.util.stream.Collectors; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTAnnotation; import net.sourceforge.pmd.lang.java.ast.ASTStringLiteral; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; public class AvoidDuplicateLiteralsRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckRule.java index d11a28d370..48268f971d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckRule.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.java.rule.errorprone; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTInfixExpression; @@ -14,6 +13,7 @@ import net.sourceforge.pmd.lang.java.ast.QualifiableExpression; import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.rule.internal.StablePathMatcher; +import net.sourceforge.pmd.reporting.RuleContext; public class BrokenNullCheckRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceRule.java index 603077c771..5c7333456e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceRule.java @@ -15,7 +15,6 @@ import java.util.Set; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTArgumentList; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; @@ -54,6 +53,7 @@ import net.sourceforge.pmd.lang.java.symbols.JTypeDeclSymbol; import net.sourceforge.pmd.lang.java.types.InvocationMatcher; import net.sourceforge.pmd.lang.java.types.TypeTestUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; /** * Makes sure you close your database connections. It does this by looking for diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodRule.java index 4ef336e6dc..8f5c41369d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodRule.java @@ -18,7 +18,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.pcollections.PVector; import org.pcollections.TreePVector; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTExpression; @@ -31,6 +30,7 @@ import net.sourceforge.pmd.lang.java.symbols.JExecutableSymbol; import net.sourceforge.pmd.lang.java.symbols.JMethodSymbol; import net.sourceforge.pmd.lang.java.types.JMethodSig; import net.sourceforge.pmd.lang.java.types.OverloadSelectionResult; +import net.sourceforge.pmd.reporting.RuleContext; /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java index a1e791c385..16a33fa087 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java @@ -16,7 +16,6 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTAnyTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTBodyDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration; @@ -41,6 +40,7 @@ import net.sourceforge.pmd.lang.java.types.JTypeMirror; import net.sourceforge.pmd.lang.java.types.JTypeVar; import net.sourceforge.pmd.lang.java.types.TypeTestUtil; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; // Note: This rule has been formerly known as "BeanMembersShouldSerialize". public class NonSerializableClassRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TypeResTestRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TypeResTestRule.java index 00908a858b..886dade7b8 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TypeResTestRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/TypeResTestRule.java @@ -7,13 +7,13 @@ package net.sourceforge.pmd.lang.java.rule.internal; import org.apache.commons.lang3.StringUtils; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.ast.JavaNode; import net.sourceforge.pmd.lang.java.ast.TypeNode; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule; import net.sourceforge.pmd.lang.java.types.JTypeMirror; import net.sourceforge.pmd.lang.java.types.TypeSystem; +import net.sourceforge.pmd.reporting.RuleContext; import net.sourceforge.pmd.util.StringUtil; /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonRule.java index 7bbee2ae2e..72da7b9d93 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonRule.java @@ -10,7 +10,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTAssignmentExpression; @@ -25,6 +24,7 @@ import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol; import net.sourceforge.pmd.lang.java.symbols.JVariableSymbol; import net.sourceforge.pmd.properties.PropertyDescriptor; +import net.sourceforge.pmd.reporting.RuleContext; public class NonThreadSafeSingletonRule extends AbstractJavaRulechainRule { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingRule.java index dc62ef5fa7..39fa1bda5c 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingRule.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.java.rule.performance; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTArgumentList; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; @@ -14,6 +13,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.rule.internal.JavaRuleUtil; +import net.sourceforge.pmd.reporting.RuleContext; /** * How this rule works: find additive expressions: + check that the addition is diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java index 8a48b275d9..c4745b2666 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java @@ -12,6 +12,7 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.java.BaseParserTest; import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule; +import net.sourceforge.pmd.reporting.Report; class ExcludeLinesTest extends BaseParserTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java index aa2c5ffa50..32e57976e9 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java @@ -14,6 +14,7 @@ import java.util.regex.Pattern; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.java.JavaParsingHelper; +import net.sourceforge.pmd.reporting.Report; class ReportTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java index 032072537f..0616127c41 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java @@ -10,10 +10,10 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.FooRule; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule; +import net.sourceforge.pmd.reporting.Report; class SuppressWarningsTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/internal/JavaViolationDecoratorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/internal/JavaViolationDecoratorTest.java index 45b131aefa..b139ea6cda 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/internal/JavaViolationDecoratorTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/internal/JavaViolationDecoratorTest.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.java.internal; -import static net.sourceforge.pmd.RuleViolation.CLASS_NAME; -import static net.sourceforge.pmd.RuleViolation.METHOD_NAME; -import static net.sourceforge.pmd.RuleViolation.PACKAGE_NAME; -import static net.sourceforge.pmd.RuleViolation.VARIABLE_NAME; +import static net.sourceforge.pmd.reporting.RuleViolation.CLASS_NAME; +import static net.sourceforge.pmd.reporting.RuleViolation.METHOD_NAME; +import static net.sourceforge.pmd.reporting.RuleViolation.PACKAGE_NAME; +import static net.sourceforge.pmd.reporting.RuleViolation.VARIABLE_NAME; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasEntry; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/DummyJavaRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/DummyJavaRule.java index d8a7bea8d6..664096ba0d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/DummyJavaRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/DummyJavaRule.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.java.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId; import net.sourceforge.pmd.lang.java.ast.JavaNode; +import net.sourceforge.pmd.reporting.RuleContext; /** * @author Clément Fournier diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/XPathRuleTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/XPathRuleTest.java index 1b8de97629..f021ae6f72 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/XPathRuleTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/XPathRuleTest.java @@ -12,9 +12,7 @@ import java.util.List; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.JavaParsingHelper; @@ -27,6 +25,8 @@ import net.sourceforge.pmd.lang.rule.xpath.internal.DeprecatedAttrLogger; import net.sourceforge.pmd.lang.rule.xpath.internal.SaxonXPathRuleQuery; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; /** * @author daniels diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java index 037cb92c30..727732bb9e 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java @@ -13,7 +13,6 @@ import java.util.function.Consumer; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.ast.FileAnalysisException; @@ -24,6 +23,7 @@ import net.sourceforge.pmd.lang.rule.XPathRule; import net.sourceforge.pmd.lang.rule.xpath.PmdXPathException; import net.sourceforge.pmd.lang.rule.xpath.PmdXPathException.Phase; import net.sourceforge.pmd.lang.rule.xpath.XPathVersion; +import net.sourceforge.pmd.reporting.Report; /** * @author Clément Fournier diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/rule/AbstractEcmascriptRule.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/rule/AbstractEcmascriptRule.java index c3f3eec489..df21241b9b 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/rule/AbstractEcmascriptRule.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/rule/AbstractEcmascriptRule.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.ecmascript.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ecmascript.ast.EcmascriptParserVisitor; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractEcmascriptRule extends AbstractRule diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java index afcbe068d3..ec87a657e4 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java @@ -12,6 +12,7 @@ import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ecmascript.ast.ASTFunctionNode; import net.sourceforge.pmd.lang.ecmascript.ast.EcmascriptParserTestBase; import net.sourceforge.pmd.lang.ecmascript.rule.AbstractEcmascriptRule; +import net.sourceforge.pmd.reporting.Report; class ReportTest extends EcmascriptParserTestBase { diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/DummyJsRule.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/DummyJsRule.java index 97ddeaa608..4a86a86808 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/DummyJsRule.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/DummyJsRule.java @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.ecmascript; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ecmascript.rule.AbstractEcmascriptRule; +import net.sourceforge.pmd.reporting.RuleContext; /** * @author Clément Fournier diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParserTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParserTest.java index ee120d4569..90e42d0043 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParserTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParserTest.java @@ -16,9 +16,9 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; import org.mozilla.javascript.ast.AstRoot; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ecmascript.rule.AbstractEcmascriptRule; +import net.sourceforge.pmd.reporting.Report; class EcmascriptParserTest extends EcmascriptParserTestBase { diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/rule/AbstractJspRule.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/rule/AbstractJspRule.java index ffe3a7b4cc..fb208c797c 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/rule/AbstractJspRule.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/rule/AbstractJspRule.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.jsp.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.jsp.ast.JspParserVisitor; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractJspRule extends AbstractRule implements JspParserVisitor { diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/rule/codestyle/DuplicateJspImportsRule.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/rule/codestyle/DuplicateJspImportsRule.java index d5b4666da6..14c9f1a641 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/rule/codestyle/DuplicateJspImportsRule.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/rule/codestyle/DuplicateJspImportsRule.java @@ -8,9 +8,9 @@ import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.jsp.ast.ASTJspDirectiveAttribute; import net.sourceforge.pmd.lang.jsp.rule.AbstractJspRule; +import net.sourceforge.pmd.reporting.RuleContext; public class DuplicateJspImportsRule extends AbstractJspRule { diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/XPathJspRuleTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/XPathJspRuleTest.java index 0fed9e17ae..183f1b17ed 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/XPathJspRuleTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/XPathJspRuleTest.java @@ -8,9 +8,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleViolation; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; class XPathJspRuleTest extends AbstractJspNodesTst { diff --git a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/AbstractKotlinRule.java b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/AbstractKotlinRule.java index 7c13206023..e824bee510 100644 --- a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/AbstractKotlinRule.java +++ b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/AbstractKotlinRule.java @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.kotlin; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.kotlin.ast.KotlinVisitor; import net.sourceforge.pmd.lang.rule.AbstractVisitorRule; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractKotlinRule extends AbstractVisitorRule { diff --git a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/rule/errorprone/OverrideBothEqualsAndHashcodeRule.java b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/rule/errorprone/OverrideBothEqualsAndHashcodeRule.java index 224ea1b7b0..80795dde56 100644 --- a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/rule/errorprone/OverrideBothEqualsAndHashcodeRule.java +++ b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/rule/errorprone/OverrideBothEqualsAndHashcodeRule.java @@ -9,7 +9,6 @@ import java.util.List; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.kotlin.AbstractKotlinRule; import net.sourceforge.pmd.lang.kotlin.ast.KotlinParser.KtClassDeclaration; import net.sourceforge.pmd.lang.kotlin.ast.KotlinParser.KtClassMemberDeclaration; @@ -20,6 +19,7 @@ import net.sourceforge.pmd.lang.kotlin.ast.KotlinTerminalNode; import net.sourceforge.pmd.lang.kotlin.ast.KotlinVisitor; import net.sourceforge.pmd.lang.kotlin.ast.KotlinVisitorBase; import net.sourceforge.pmd.lang.rule.RuleTargetSelector; +import net.sourceforge.pmd.reporting.RuleContext; public class OverrideBothEqualsAndHashcodeRule extends AbstractKotlinRule { diff --git a/pmd-lang-test/src/main/java/net/sourceforge/pmd/test/AbstractMetricTestRule.java b/pmd-lang-test/src/main/java/net/sourceforge/pmd/test/AbstractMetricTestRule.java index 4c18a4eb8b..35f65663fe 100644 --- a/pmd-lang-test/src/main/java/net/sourceforge/pmd/test/AbstractMetricTestRule.java +++ b/pmd-lang-test/src/main/java/net/sourceforge/pmd/test/AbstractMetricTestRule.java @@ -9,7 +9,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.metrics.Metric; import net.sourceforge.pmd.lang.metrics.MetricOption; @@ -17,6 +16,7 @@ import net.sourceforge.pmd.lang.metrics.MetricOptions; import net.sourceforge.pmd.lang.rule.AbstractRule; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseParsingHelper.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseParsingHelper.kt index 46c3d9b272..431f99d991 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseParsingHelper.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseParsingHelper.kt @@ -16,6 +16,7 @@ import net.sourceforge.pmd.lang.document.TextDocument import net.sourceforge.pmd.lang.rule.XPathRule import net.sourceforge.pmd.lang.rule.xpath.XPathVersion import net.sourceforge.pmd.reporting.GlobalAnalysisListener +import net.sourceforge.pmd.reporting.Report import java.io.InputStream import java.nio.charset.StandardCharsets import java.nio.file.Files diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt index 5819192522..e037138889 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/TestUtils.kt @@ -8,8 +8,8 @@ import io.kotest.assertions.withClue import io.kotest.matchers.Matcher import io.kotest.matchers.equalityMatcher import io.kotest.matchers.should -import net.sourceforge.pmd.Report -import net.sourceforge.pmd.RuleViolation +import net.sourceforge.pmd.reporting.Report +import net.sourceforge.pmd.reporting.RuleViolation import net.sourceforge.pmd.lang.ast.Node import net.sourceforge.pmd.lang.document.Chars import kotlin.reflect.KCallable diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java index 900cf1eea7..bb635578bd 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.modelica.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.modelica.ast.ModelicaParserVisitor; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; /** * Base class for rules for Modelica language. diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/AbstractPLSQLRule.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/AbstractPLSQLRule.java index afa94e1f6c..18d03d691a 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/AbstractPLSQLRule.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/AbstractPLSQLRule.java @@ -5,7 +5,6 @@ package net.sourceforge.pmd.lang.plsql.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.plsql.ast.ASTInput; import net.sourceforge.pmd.lang.plsql.ast.ASTPackageBody; @@ -16,6 +15,7 @@ import net.sourceforge.pmd.lang.plsql.ast.ASTTypeSpecification; import net.sourceforge.pmd.lang.plsql.ast.ExecutableCode; import net.sourceforge.pmd.lang.plsql.ast.PLSQLParserVisitor; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractPLSQLRule extends AbstractRule implements PLSQLParserVisitor { diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/PLSQLXPathRuleTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/PLSQLXPathRuleTest.java index 09f9013008..5919fa8e55 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/PLSQLXPathRuleTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/PLSQLXPathRuleTest.java @@ -8,9 +8,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.lang.rule.XPathRule; import net.sourceforge.pmd.lang.rule.xpath.XPathVersion; +import net.sourceforge.pmd.reporting.Report; /** * Tests to use XPath rules with PLSQL. diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/rule/ScalaRule.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/rule/ScalaRule.java index a385df3465..65de1b6a6a 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/rule/ScalaRule.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/rule/ScalaRule.java @@ -4,11 +4,11 @@ package net.sourceforge.pmd.lang.scala.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; import net.sourceforge.pmd.lang.scala.ast.ScalaNode; import net.sourceforge.pmd.lang.scala.ast.ScalaParserVisitor; +import net.sourceforge.pmd.reporting.RuleContext; /** * The default base implementation of a PMD Rule for Scala. Uses the Visitor diff --git a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/rule/ScalaRuleTest.java b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/rule/ScalaRuleTest.java index 144593dfef..e1dc81444e 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/rule/ScalaRuleTest.java +++ b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/rule/ScalaRuleTest.java @@ -10,13 +10,13 @@ import java.util.concurrent.atomic.AtomicInteger; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.scala.ast.ASTSource; import net.sourceforge.pmd.lang.scala.ast.ASTTermApply; import net.sourceforge.pmd.lang.scala.ast.ASTTermName; import net.sourceforge.pmd.lang.scala.ast.BaseScalaTest; import net.sourceforge.pmd.lang.scala.ast.ScalaNode; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleContext; class ScalaRuleTest extends BaseScalaTest { diff --git a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/rule/XPathRuleTest.java b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/rule/XPathRuleTest.java index 303040dc59..88a675de95 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/rule/XPathRuleTest.java +++ b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/rule/XPathRuleTest.java @@ -8,10 +8,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.rule.XPathRule; import net.sourceforge.pmd.lang.scala.ast.BaseScalaTest; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; class XPathRuleTest extends BaseScalaTest { diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/AbstractSwiftRule.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/AbstractSwiftRule.java index 9c5a43c722..ae1cc195b0 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/AbstractSwiftRule.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/AbstractSwiftRule.java @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.swift.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.rule.AbstractVisitorRule; import net.sourceforge.pmd.lang.swift.ast.SwiftVisitor; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractSwiftRule extends AbstractVisitorRule { diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java index 9c4a5a1df3..59d2d857c5 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.swift.rule.bestpractices; import java.util.List; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.swift.ast.SwiftParser.SwAttribute; import net.sourceforge.pmd.lang.swift.ast.SwiftParser.SwAttributes; import net.sourceforge.pmd.lang.swift.ast.SwiftParser.SwCodeBlock; @@ -16,6 +15,7 @@ import net.sourceforge.pmd.lang.swift.ast.SwiftParser.SwStatement; import net.sourceforge.pmd.lang.swift.ast.SwiftVisitor; import net.sourceforge.pmd.lang.swift.ast.SwiftVisitorBase; import net.sourceforge.pmd.lang.swift.rule.AbstractSwiftRule; +import net.sourceforge.pmd.reporting.RuleContext; public class UnavailableFunctionRule extends AbstractSwiftRule { diff --git a/pmd-test-schema/src/test/java/net/sourceforge/pmd/test/schema/TestSchemaParserTest.java b/pmd-test-schema/src/test/java/net/sourceforge/pmd/test/schema/TestSchemaParserTest.java index 50dde9dc41..73878474ae 100644 --- a/pmd-test-schema/src/test/java/net/sourceforge/pmd/test/schema/TestSchemaParserTest.java +++ b/pmd-test-schema/src/test/java/net/sourceforge/pmd/test/schema/TestSchemaParserTest.java @@ -15,10 +15,10 @@ import java.io.StringReader; import org.junit.jupiter.api.Test; import org.xml.sax.InputSource; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.PlainTextLanguage; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.reporting.RuleContext; import com.github.stefanbirkner.systemlambda.SystemLambda; diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java b/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java index 546d77c7f2..907582a441 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java @@ -26,18 +26,18 @@ import org.xml.sax.InputSource; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.RuleSetLoadException; import net.sourceforge.pmd.RuleSetLoader; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.renderers.TextRenderer; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; import net.sourceforge.pmd.test.schema.RuleTestCollection; import net.sourceforge.pmd.test.schema.RuleTestDescriptor; import net.sourceforge.pmd.test.schema.TestSchemaParser; diff --git a/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java b/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java index 7d19147c12..5f169df1a2 100644 --- a/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java +++ b/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java @@ -17,7 +17,6 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.LanguageVersion; @@ -25,6 +24,7 @@ import net.sourceforge.pmd.lang.ast.DummyNode.DummyRootNode; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; import net.sourceforge.pmd.lang.rule.RuleTargetSelector; +import net.sourceforge.pmd.reporting.RuleContext; import net.sourceforge.pmd.test.schema.RuleTestDescriptor; class RuleTstTest { diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/AbstractVfRule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/AbstractVfRule.java index 4fb6e82f79..f7d64546d8 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/AbstractVfRule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/AbstractVfRule.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.vf.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; import net.sourceforge.pmd.lang.vf.ast.VfParserVisitor; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractVfRule extends AbstractRule implements VfParserVisitor { diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java index b1032c5d26..880ea0641f 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfUnescapeElTest.java @@ -12,11 +12,11 @@ import java.util.List; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.vf.VFTestUtils; import net.sourceforge.pmd.lang.vf.ast.VfParsingHelper; +import net.sourceforge.pmd.reporting.Report; +import net.sourceforge.pmd.reporting.RuleViolation; import net.sourceforge.pmd.testframework.PmdRuleTst; class VfUnescapeElTest extends PmdRuleTst { diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/AbstractVmRule.java b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/AbstractVmRule.java index b309c8edf1..2cc6bfd5ea 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/AbstractVmRule.java +++ b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/rule/AbstractVmRule.java @@ -4,10 +4,10 @@ package net.sourceforge.pmd.lang.vm.rule; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; import net.sourceforge.pmd.lang.vm.ast.VmParserVisitor; +import net.sourceforge.pmd.reporting.RuleContext; public abstract class AbstractVmRule extends AbstractRule implements VmParserVisitor { diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/rule/DomXPathRule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/rule/DomXPathRule.java index ce2df9d9de..c25cd0a192 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/rule/DomXPathRule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/rule/DomXPathRule.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.xml.rule; import java.util.Objects; -import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; @@ -14,6 +13,7 @@ import net.sourceforge.pmd.lang.rule.XPathRule; import net.sourceforge.pmd.lang.xml.ast.internal.XmlParserImpl.RootXmlNode; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; +import net.sourceforge.pmd.reporting.RuleContext; /** * XPath rule that executes an expression on the DOM directly, and not diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/XmlXPathRuleTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/XmlXPathRuleTest.java index 36bdb5fb49..fbddf2f3de 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/XmlXPathRuleTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/rule/XmlXPathRuleTest.java @@ -8,10 +8,10 @@ import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.xml.XmlParsingHelper; +import net.sourceforge.pmd.reporting.Report; class XmlXPathRuleTest {