diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 544d54f101..befd17d68d 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -151,9 +151,21 @@ in the Migration Guide. #### API Changes -**Moved classes** +**Moved classes/consolidated packages** * pmd-core - * The interface {%jdoc core::rule.Rule %} has been moved into the new package {% jdoc_package core::rule %}. + * Many types have been moved from the base package `net.sourceforge.pmd` into the new subpackage {% jdoc_package core::rule %} + * {%jdoc core::rule.Rule %} + * {%jdoc core::rule.RuleFactory %} (moved from `net.sourceforge.pmd.rules`; it has now been hidden from public API) + * {%jdoc core::rule.RulePriority %} + * {%jdoc core::rule.RuleSet %} + * {%jdoc core::rule.RuleSetFactory %} + * {%jdoc core::rule.RuleSetFactoryCompatibility %} + * {%jdoc core::rule.RuleSetLoader %} + * {%jdoc core::rule.RuleSetLoadException %} + * {%jdoc core::rule.RuleSetReference %} (note: this is _not_ public API) + * {%jdoc core::rule.RuleSetReferenceId %} (has been hidden from public API) + * {%jdoc core::rule.RuleSets %} (note: this is _not_ public API) + * {%jdoc core::rule.RuleSetWriter %} **Removed classes and methods** diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java index db10833ff7..215f2929f0 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/PMDTask.java @@ -17,9 +17,9 @@ import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.Resource; -import net.sourceforge.pmd.RulePriority; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.ant.internal.PMDTaskImpl; +import net.sourceforge.pmd.rule.RulePriority; /** * PMD Ant task. Setters of this class are interpreted by Ant as properties diff --git a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/internal/PMDTaskImpl.java b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/internal/PMDTaskImpl.java index 3bd399fc64..1f48d23553 100644 --- a/pmd-ant/src/main/java/net/sourceforge/pmd/ant/internal/PMDTaskImpl.java +++ b/pmd-ant/src/main/java/net/sourceforge/pmd/ant/internal/PMDTaskImpl.java @@ -23,8 +23,6 @@ import org.slf4j.event.Level; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.RulePriority; -import net.sourceforge.pmd.RuleSetLoader; import net.sourceforge.pmd.ant.Formatter; import net.sourceforge.pmd.ant.PMDTask; import net.sourceforge.pmd.ant.SourceLanguage; @@ -39,6 +37,8 @@ import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; import net.sourceforge.pmd.reporting.ReportStats; import net.sourceforge.pmd.reporting.ReportStatsListener; +import net.sourceforge.pmd.rule.RulePriority; +import net.sourceforge.pmd.rule.RuleSetLoader; public class PMDTaskImpl { diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/DefaultRulesetTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/DefaultRulesetTest.java index 3ca9685389..f2b360cba9 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/DefaultRulesetTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/DefaultRulesetTest.java @@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; -import net.sourceforge.pmd.RuleSet; -import net.sourceforge.pmd.RuleSetLoader; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoader; import com.github.stefanbirkner.systemlambda.SystemLambda; diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/RuleSetFactoryTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/RuleSetFactoryTest.java index fb955369af..38383cb831 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/RuleSetFactoryTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.apex; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional tests yet 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 c64c4158db..f6d18cf2da 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 @@ -16,8 +16,6 @@ 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.RuleSet; -import net.sourceforge.pmd.RuleSetLoader; import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageVersion; @@ -25,6 +23,8 @@ import net.sourceforge.pmd.lang.apex.ApexLanguageModule; import net.sourceforge.pmd.lang.apex.ApexLanguageProperties; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoader; import com.nawforce.pkgforce.path.PathFactory; import com.nawforce.pkgforce.path.PathLike; diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java index 29758b74be..4536ad05c0 100644 --- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java +++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdCommand.java @@ -20,7 +20,6 @@ import org.slf4j.LoggerFactory; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.RulePriority; import net.sourceforge.pmd.benchmark.TextTimingReportRenderer; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimingReport; @@ -37,6 +36,7 @@ import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.renderers.Renderer; import net.sourceforge.pmd.renderers.RendererFactory; import net.sourceforge.pmd.reporting.ReportStats; +import net.sourceforge.pmd.rule.RulePriority; import net.sourceforge.pmd.util.StringUtil; import net.sourceforge.pmd.util.log.MessageReporter; import net.sourceforge.pmd.util.log.internal.SimpleMessageReporter; diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/RulePriorityTypeSupport.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/RulePriorityTypeSupport.java index 48ee080be9..82660c26be 100644 --- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/RulePriorityTypeSupport.java +++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/RulePriorityTypeSupport.java @@ -8,7 +8,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import net.sourceforge.pmd.RulePriority; +import net.sourceforge.pmd.rule.RulePriority; import picocli.CommandLine.ITypeConverter; import picocli.CommandLine.TypeConversionException; diff --git a/pmd-compat6/src/main/java/net/sourceforge/pmd/PMDConfiguration.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/PMDConfiguration.java index 87175d7405..90954321a7 100644 --- a/pmd-compat6/src/main/java/net/sourceforge/pmd/PMDConfiguration.java +++ b/pmd-compat6/src/main/java/net/sourceforge/pmd/PMDConfiguration.java @@ -32,6 +32,8 @@ import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.renderers.Renderer; import net.sourceforge.pmd.renderers.RendererFactory; +import net.sourceforge.pmd.rule.RulePriority; +import net.sourceforge.pmd.rule.RuleSetLoader; import net.sourceforge.pmd.util.AssertionUtil; import net.sourceforge.pmd.util.log.internal.SimpleMessageReporter; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/PMDConfiguration.java b/pmd-core/src/main/java/net/sourceforge/pmd/PMDConfiguration.java index b262878dfe..8eaa7de870 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/PMDConfiguration.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/PMDConfiguration.java @@ -29,6 +29,8 @@ import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.renderers.Renderer; import net.sourceforge.pmd.renderers.RendererFactory; +import net.sourceforge.pmd.rule.RulePriority; +import net.sourceforge.pmd.rule.RuleSetLoader; import net.sourceforge.pmd.util.AssertionUtil; import net.sourceforge.pmd.util.log.internal.SimpleMessageReporter; 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 5293246812..23bac0ab59 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/PmdAnalysis.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/PmdAnalysis.java @@ -50,6 +50,9 @@ import net.sourceforge.pmd.reporting.ListenerInitializer; import net.sourceforge.pmd.reporting.ReportStats; import net.sourceforge.pmd.reporting.ReportStatsListener; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoader; +import net.sourceforge.pmd.rule.RuleSets; import net.sourceforge.pmd.util.AssertionUtil; import net.sourceforge.pmd.util.StringUtil; import net.sourceforge.pmd.util.log.MessageReporter; 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..21904f6756 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 @@ -27,7 +27,6 @@ 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; @@ -39,6 +38,7 @@ 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.rule.RuleSets; /** * 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..4eaf19bb27 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 @@ -8,13 +8,13 @@ import java.io.IOException; 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.rule.RuleSets; /** * An analysis cache for incremental analysis. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisCacheListener.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisCacheListener.java index 702631244c..af16b0c944 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisCacheListener.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AnalysisCacheListener.java @@ -7,11 +7,11 @@ package net.sourceforge.pmd.cache; import java.io.IOException; import java.util.Collection; -import net.sourceforge.pmd.RuleSets; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; +import net.sourceforge.pmd.rule.RuleSets; /** * Adapter to wrap {@link AnalysisCache} behaviour in a {@link GlobalAnalysisListener}. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleMapper.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleMapper.java index 31c41174eb..456abfade1 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleMapper.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleMapper.java @@ -7,9 +7,9 @@ package net.sourceforge.pmd.cache; import java.util.HashMap; import java.util.Map; -import net.sourceforge.pmd.RuleSets; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSets; /** * A mapper from rule class names to rule instances for cached rules. 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..2e2eb73a3c 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 @@ -19,7 +19,6 @@ import java.util.Map; 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; @@ -27,6 +26,7 @@ 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.rule.RuleSets; /** * 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..005e408616 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 @@ -8,12 +8,12 @@ import java.util.Collection; 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.rule.RuleSets; /** * A NOOP analysis cache. Easier / safer than null-checking. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageProcessor.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageProcessor.java index ccdc14248d..68e6f1de86 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageProcessor.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageProcessor.java @@ -9,11 +9,11 @@ import java.util.List; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.RuleSets; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.cache.AnalysisCache; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; +import net.sourceforge.pmd.rule.RuleSets; import net.sourceforge.pmd.util.log.MessageReporter; /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessor.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessor.java index fe26c289f6..72315336c8 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessor.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessor.java @@ -4,9 +4,9 @@ package net.sourceforge.pmd.lang.impl; -import net.sourceforge.pmd.RuleSets; import net.sourceforge.pmd.lang.LanguageProcessor.AnalysisTask; import net.sourceforge.pmd.lang.document.TextFile; +import net.sourceforge.pmd.rule.RuleSets; /** * @author Romain Pelisse <belaran@gmail.com> diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessor.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessor.java index cd0e26dc37..c115d21415 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessor.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/impl/MultiThreadProcessor.java @@ -12,9 +12,9 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import net.sourceforge.pmd.RuleSets; import net.sourceforge.pmd.lang.LanguageProcessor.AnalysisTask; import net.sourceforge.pmd.lang.document.TextFile; +import net.sourceforge.pmd.rule.RuleSets; import net.sourceforge.pmd.util.log.MessageReporter; 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..6c085cdfbd 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 @@ -10,7 +10,6 @@ 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; @@ -29,6 +28,7 @@ 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.rule.RuleSets; /** * 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 a1b2386402..f3f11349e0 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.RuleContext; -import net.sourceforge.pmd.RulePriority; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.LanguageVersion; @@ -16,6 +15,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertySource; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RulePriority; /** * 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 cf7db90d0b..081696930e 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.RuleContext; -import net.sourceforge.pmd.RulePriority; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.ast.Node; @@ -24,6 +23,7 @@ import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.properties.AbstractPropertySource; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RulePriority; /** * Basic abstract implementation of all parser-independent methods of the Rule diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/RuleReference.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/RuleReference.java index a0f9b75734..374a26208d 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/RuleReference.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/RuleReference.java @@ -12,11 +12,11 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import net.sourceforge.pmd.RulePriority; -import net.sourceforge.pmd.RuleSetReference; import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RulePriority; +import net.sourceforge.pmd.rule.RuleSetReference; import net.sourceforge.pmd.util.StringUtil; /** 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 a1b9f089fd..8036814d7a 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 @@ -13,7 +13,6 @@ import org.slf4j.LoggerFactory; import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.RuleContext; -import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimedOperation; import net.sourceforge.pmd.benchmark.TimedOperationCategory; @@ -23,6 +22,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet; import net.sourceforge.pmd.util.AssertionUtil; import net.sourceforge.pmd.util.StringUtil; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/properties/PropertyDescriptor.java b/pmd-core/src/main/java/net/sourceforge/pmd/properties/PropertyDescriptor.java index 5bd40d48fb..a8c3d51264 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/properties/PropertyDescriptor.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/properties/PropertyDescriptor.java @@ -8,8 +8,8 @@ import java.util.Objects; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.RuleSetWriter; import net.sourceforge.pmd.annotation.InternalApi; +import net.sourceforge.pmd.rule.RuleSetWriter; /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/rule/Rule.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/Rule.java index 0a8fee6e5b..6d2ed5c65d 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/rule/Rule.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/Rule.java @@ -9,8 +9,6 @@ import java.util.Optional; import java.util.regex.Pattern; import net.sourceforge.pmd.RuleContext; -import net.sourceforge.pmd.RulePriority; -import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.LanguageVersion; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleFactory.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleFactory.java similarity index 98% rename from pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleFactory.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleFactory.java index d918629299..4f15ad3420 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleFactory.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleFactory.java @@ -2,7 +2,7 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.rules; +package net.sourceforge.pmd.rule; import static net.sourceforge.pmd.util.internal.xml.SchemaConstants.CLASS; import static net.sourceforge.pmd.util.internal.xml.SchemaConstants.DELIMITER; @@ -41,9 +41,6 @@ import org.w3c.dom.Attr; import org.w3c.dom.Element; import org.w3c.dom.Node; -import net.sourceforge.pmd.RulePriority; -import net.sourceforge.pmd.RuleSetReference; -import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.LanguageVersion; @@ -56,7 +53,6 @@ import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertySerializer; import net.sourceforge.pmd.properties.PropertyTypeId; import net.sourceforge.pmd.properties.PropertyTypeId.BuilderAndMapper; -import net.sourceforge.pmd.rule.Rule; import net.sourceforge.pmd.util.ResourceLoader; import net.sourceforge.pmd.util.StringUtil; import net.sourceforge.pmd.util.internal.xml.PmdXmlReporter; @@ -75,9 +71,7 @@ import com.github.oowekyala.ooxml.messages.XmlException; * @author Clément Fournier * @since 6.0.0 */ -@InternalApi -@Deprecated -public class RuleFactory { +class RuleFactory { private final ResourceLoader resourceLoader; private final LanguageRegistry languageRegistry; @@ -85,7 +79,7 @@ public class RuleFactory { /** * @param resourceLoader The resource loader to load the rule from jar */ - public RuleFactory(ResourceLoader resourceLoader, + RuleFactory(ResourceLoader resourceLoader, LanguageRegistry languageRegistry) { this.resourceLoader = resourceLoader; this.languageRegistry = languageRegistry; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RulePriority.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RulePriority.java similarity index 99% rename from pmd-core/src/main/java/net/sourceforge/pmd/RulePriority.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RulePriority.java index 8f8b97996b..08cde9f3ee 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RulePriority.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RulePriority.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.rule; /** * These are the possible Rule priority values. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSet.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSet.java similarity index 99% rename from pmd-core/src/main/java/net/sourceforge/pmd/RuleSet.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSet.java index 3f5f149e7b..9c44c29d7e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSet.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSet.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.rule; import java.util.ArrayList; import java.util.Arrays; @@ -28,7 +28,6 @@ import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.rule.RuleReference; import net.sourceforge.pmd.lang.rule.XPathRule; -import net.sourceforge.pmd.rule.Rule; /** * This class represents a collection of rules along with some optional filter diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactory.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetFactory.java similarity index 99% rename from pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactory.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetFactory.java index 81e7b1675a..20a2e1ab7e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactory.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetFactory.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.rule; import static net.sourceforge.pmd.util.CollectionUtil.setOf; import static net.sourceforge.pmd.util.internal.xml.SchemaConstants.DESCRIPTION; @@ -45,11 +45,10 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; -import net.sourceforge.pmd.RuleSet.RuleSetBuilder; +import net.sourceforge.pmd.PMDVersion; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.rule.RuleReference; -import net.sourceforge.pmd.rule.Rule; -import net.sourceforge.pmd.rules.RuleFactory; +import net.sourceforge.pmd.rule.RuleSet.RuleSetBuilder; import net.sourceforge.pmd.util.ResourceLoader; import net.sourceforge.pmd.util.StringUtil; import net.sourceforge.pmd.util.internal.xml.PmdXmlReporter; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactoryCompatibility.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetFactoryCompatibility.java similarity index 99% rename from pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactoryCompatibility.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetFactoryCompatibility.java index 610676a92c..11f2c9c37f 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactoryCompatibility.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetFactoryCompatibility.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.rule; import java.text.MessageFormat; import java.util.ArrayList; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoadException.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetLoadException.java similarity index 96% rename from pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoadException.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetLoadException.java index b83355e1c6..dd4156cceb 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoadException.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetLoadException.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.rule; import org.checkerframework.checker.nullness.qual.NonNull; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoader.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetLoader.java similarity index 99% rename from pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoader.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetLoader.java index 08032a14b6..9f238348a1 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoader.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetLoader.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.rule; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -21,10 +21,10 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; -import net.sourceforge.pmd.rule.Rule; import net.sourceforge.pmd.util.CollectionUtil; import net.sourceforge.pmd.util.ResourceLoader; import net.sourceforge.pmd.util.log.MessageReporter; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReference.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetReference.java similarity index 97% rename from pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReference.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetReference.java index cdc6e5f77c..5e6d7cd3cd 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReference.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetReference.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.rule; import java.util.Collections; import java.util.LinkedHashSet; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetReferenceId.java similarity index 98% rename from pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetReferenceId.java index 7afa4f78b2..c21f7f7254 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetReferenceId.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.rule; import java.io.File; import java.io.FileNotFoundException; @@ -17,7 +17,6 @@ import java.util.Objects; import org.apache.commons.lang3.StringUtils; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.util.ResourceLoader; import net.sourceforge.pmd.util.log.MessageReporter; @@ -74,11 +73,9 @@ import net.sourceforge.pmd.util.log.MessageReporter; * * * - * @deprecated This is part of the internals of the {@link RuleSetLoader}. + *

Note: This is part of the internals of the {@link RuleSetLoader}. */ -@Deprecated -@InternalApi -public class RuleSetReferenceId { +class RuleSetReferenceId { // todo this class has issues... What is even an "external" ruleset? // terminology and API should be clarified. @@ -99,8 +96,7 @@ public class RuleSetReferenceId { * @throws IllegalArgumentException * If the ID contains a comma character. */ - public RuleSetReferenceId(final String id) { - + RuleSetReferenceId(final String id) { this(id, null, null); } @@ -127,7 +123,7 @@ public class RuleSetReferenceId { * @throws IllegalArgumentException If the ID is not Rule reference when there is an external * RuleSetReferenceId. */ - public RuleSetReferenceId(final String id, final RuleSetReferenceId externalRuleSetReferenceId) { + RuleSetReferenceId(final String id, final RuleSetReferenceId externalRuleSetReferenceId) { this(id, externalRuleSetReferenceId, null); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetWriter.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetWriter.java similarity index 99% rename from pmd-core/src/main/java/net/sourceforge/pmd/RuleSetWriter.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetWriter.java index 88e3757635..55b24ba0ad 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetWriter.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSetWriter.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.rule; import java.io.OutputStream; import java.util.HashSet; @@ -40,7 +40,6 @@ import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertySerializer; import net.sourceforge.pmd.properties.PropertySource; import net.sourceforge.pmd.properties.PropertyTypeId; -import net.sourceforge.pmd.rule.Rule; import net.sourceforge.pmd.util.internal.xml.SchemaConstants; /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSets.java b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSets.java similarity index 99% rename from pmd-core/src/main/java/net/sourceforge/pmd/RuleSets.java rename to pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSets.java index 062c527635..74d696e327 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSets.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rule/RuleSets.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.rule; import java.util.ArrayList; import java.util.Collection; @@ -21,7 +21,6 @@ import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.rule.internal.RuleApplicator; import net.sourceforge.pmd.reporting.FileAnalysisListener; -import net.sourceforge.pmd.rule.Rule; import net.sourceforge.pmd.util.log.MessageReporter; /** 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..aa90355377 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java @@ -29,6 +29,7 @@ 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.rule.RulePriority; class AbstractRuleTest { 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..4dabeccf99 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/PmdAnalysisTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/PmdAnalysisTest.java @@ -22,7 +22,6 @@ import org.junit.jupiter.api.Test; import org.mockito.ArgumentMatchers; import org.mockito.Mockito; -import net.sourceforge.pmd.RuleSetTest.MockRule; import net.sourceforge.pmd.lang.Dummy2LanguageModule; import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.Language; @@ -33,6 +32,8 @@ 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.ReportStats; +import net.sourceforge.pmd.rule.MockRule; +import net.sourceforge.pmd.rule.RuleSet; import net.sourceforge.pmd.util.log.MessageReporter; /** diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/PmdConfigurationTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/PmdConfigurationTest.java index 036a03ee85..8ab1020315 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/PmdConfigurationTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/PmdConfigurationTest.java @@ -35,6 +35,7 @@ import net.sourceforge.pmd.cache.NoopAnalysisCache; import net.sourceforge.pmd.internal.util.ClasspathClassLoader; import net.sourceforge.pmd.renderers.CSVRenderer; import net.sourceforge.pmd.renderers.Renderer; +import net.sourceforge.pmd.rule.RulePriority; class PmdConfigurationTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/ReportTestUtil.java b/pmd-core/src/test/java/net/sourceforge/pmd/ReportTestUtil.java index fd455f4811..91c56afacb 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/ReportTestUtil.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/ReportTestUtil.java @@ -11,6 +11,8 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.document.TestMessageReporter; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSets; public final class ReportTestUtil { private ReportTestUtil() { 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 069f51f48b..b1cf43bf29 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 @@ -36,7 +36,6 @@ import org.junit.jupiter.api.io.TempDir; 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; @@ -49,6 +48,7 @@ import net.sourceforge.pmd.lang.document.TextRange2d; import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSets; class FileAnalysisCacheTest { 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..a4be8f6a8a 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 @@ -17,7 +17,6 @@ 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; @@ -28,6 +27,7 @@ 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.rule.RuleSet; import net.sourceforge.pmd.util.log.MessageReporter; abstract class AbstractPMDProcessorTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessorTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessorTest.java index 755003142b..073ee36199 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessorTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/impl/MonoThreadProcessorTest.java @@ -11,7 +11,7 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; import net.sourceforge.pmd.PmdAnalysis; -import net.sourceforge.pmd.RuleSet; +import net.sourceforge.pmd.rule.RuleSet; class MonoThreadProcessorTest extends 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..8feda5a284 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 @@ -15,9 +15,9 @@ 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.rule.RuleSet; 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..bea03e58ff 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 @@ -7,10 +7,10 @@ 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.rule.RulePriority; /** 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..891657072a 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 @@ -5,8 +5,8 @@ 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.rule.RulePriority; /** 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 71e4388659..dbfde85c78 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 @@ -29,7 +29,6 @@ import net.sourceforge.pmd.PmdAnalysis; import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.RuleContext; -import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.internal.SystemProps; import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.LanguageRegistry; @@ -41,6 +40,7 @@ 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.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet; import net.sourceforge.pmd.util.ContextedAssertionError; import net.sourceforge.pmd.util.log.MessageReporter; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/properties/PropertySyntaxTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/properties/PropertySyntaxTest.java index a6e7582f5d..204a1b6bd8 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/properties/PropertySyntaxTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/properties/PropertySyntaxTest.java @@ -13,8 +13,8 @@ import java.util.ArrayList; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.RulesetFactoryTestBase; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RulesetFactoryTestBase; import net.sourceforge.pmd.util.internal.xml.XmlErrorMessages; /** 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 6f16fa705e..cb98fafa56 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 @@ -25,7 +25,6 @@ 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.RulePriority; import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.RuleWithProperties; import net.sourceforge.pmd.internal.util.IOUtil; @@ -39,6 +38,7 @@ import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.reporting.FileAnalysisListener; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RulePriority; abstract class 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 70a776bf49..3da7d7b0da 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,13 +22,13 @@ import net.sourceforge.pmd.FooRule; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; import net.sourceforge.pmd.RuleContext; -import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.cache.AnalysisCache; import net.sourceforge.pmd.cache.NoopAnalysisCache; import net.sourceforge.pmd.lang.ast.FileAnalysisException; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet; class GlobalAnalysisListenerTest { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/rule/MockRule.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/MockRule.java new file mode 100644 index 0000000000..93395bc1dc --- /dev/null +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/MockRule.java @@ -0,0 +1,24 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.rule; + +import net.sourceforge.pmd.lang.DummyLanguageModule; + +public class MockRule extends net.sourceforge.pmd.lang.rule.MockRule { + public MockRule() { + super(); + setLanguage(DummyLanguageModule.getInstance()); + } + + public MockRule(String name, String description, String message, String ruleSetName, RulePriority priority) { + super(name, description, message, ruleSetName, priority); + setLanguage(DummyLanguageModule.getInstance()); + } + + public MockRule(String name, String description, String message, String ruleSetName) { + super(name, description, message, ruleSetName); + setLanguage(DummyLanguageModule.getInstance()); + } +} diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleReferenceTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleReferenceTest.java similarity index 99% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleReferenceTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleReferenceTest.java index 038481b979..17f4eacfe3 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleReferenceTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleReferenceTest.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.rule; import static net.sourceforge.pmd.PmdCoreTestUtils.dummyLanguage; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryCompatibilityTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryCompatibilityTest.java similarity index 99% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryCompatibilityTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryCompatibilityTest.java index f9e3c089bb..6f46cad48b 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryCompatibilityTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryCompatibilityTest.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.rule; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryDuplicatedRuleLoggingTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryDuplicatedRuleLoggingTest.java similarity index 98% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryDuplicatedRuleLoggingTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryDuplicatedRuleLoggingTest.java index 7b2296242b..e305bfe8c9 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryDuplicatedRuleLoggingTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryDuplicatedRuleLoggingTest.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.rule; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -12,8 +12,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.rule.Rule; - import com.github.stefanbirkner.systemlambda.SystemLambda; class RuleSetFactoryDuplicatedRuleLoggingTest extends RulesetFactoryTestBase { diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryMessagesTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryMessagesTest.java similarity index 98% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryMessagesTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryMessagesTest.java index 5d35ef24aa..1091ced2de 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryMessagesTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryMessagesTest.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.rule; import static net.sourceforge.pmd.util.CollectionUtil.listOf; import static org.hamcrest.MatcherAssert.assertThat; @@ -12,7 +12,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.rule.MockRule; -import net.sourceforge.pmd.rule.Rule; import net.sourceforge.pmd.util.internal.xml.SchemaConstants; import net.sourceforge.pmd.util.internal.xml.XmlErrorMessages; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryTest.java similarity index 97% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryTest.java index 80070f3b83..63b8580dfa 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetFactoryTest.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.rule; import static net.sourceforge.pmd.PmdCoreTestUtils.dummyLanguage; import static net.sourceforge.pmd.util.CollectionUtil.listOf; @@ -28,36 +28,37 @@ import org.mockito.Mockito; import net.sourceforge.pmd.lang.rule.MockRule; import net.sourceforge.pmd.lang.rule.RuleReference; import net.sourceforge.pmd.properties.PropertyDescriptor; -import net.sourceforge.pmd.rule.Rule; import net.sourceforge.pmd.util.ResourceLoader; import net.sourceforge.pmd.util.internal.xml.SchemaConstants; import com.github.stefanbirkner.systemlambda.SystemLambda; class RuleSetFactoryTest extends RulesetFactoryTestBase { + private static final String TEST_RULESET_1 = "net/sourceforge/pmd/rule/TestRuleset1.xml"; + private static final String REFERENCE_RULESET = "net/sourceforge/pmd/rule/reference-ruleset.xml"; @Test void testRuleSetFileName() { RuleSet rs = new RuleSetLoader().loadFromString("dummyRuleset.xml", EMPTY_RULESET); assertEquals("dummyRuleset.xml", rs.getFileName()); - rs = new RuleSetLoader().loadFromResource("net/sourceforge/pmd/TestRuleset1.xml"); - assertEquals(rs.getFileName(), "net/sourceforge/pmd/TestRuleset1.xml", "wrong RuleSet file name"); + rs = new RuleSetLoader().loadFromResource(TEST_RULESET_1); + assertEquals(rs.getFileName(), TEST_RULESET_1, "wrong RuleSet file name"); } @Test void testRefs() { - RuleSet rs = new RuleSetLoader().loadFromResource("net/sourceforge/pmd/TestRuleset1.xml"); + RuleSet rs = new RuleSetLoader().loadFromResource(TEST_RULESET_1); assertNotNull(rs.getRuleByName("TestRuleRef")); } @Test void testExtendedReferences() throws Exception { - InputStream in = new ResourceLoader().loadClassPathResourceAsStream("net/sourceforge/pmd/rulesets/reference-ruleset.xml"); + InputStream in = new ResourceLoader().loadClassPathResourceAsStream(REFERENCE_RULESET); assertNotNull(in, "Test ruleset not found - can't continue with test!"); in.close(); - RuleSet rs = new RuleSetLoader().loadFromResource("net/sourceforge/pmd/rulesets/reference-ruleset.xml"); + RuleSet rs = new RuleSetLoader().loadFromResource(REFERENCE_RULESET); // added by referencing a complete ruleset (TestRuleset1.xml) assertNotNull(rs.getRuleByName("MockRule1")); assertNotNull(rs.getRuleByName("MockRule2")); @@ -781,7 +782,7 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { void testExternalReferences() { RuleSet rs = loadRuleSet( rulesetXml( - ruleRef("net/sourceforge/pmd/external-reference-ruleset.xml/MockRule") + ruleRef("net/sourceforge/pmd/rule/external-reference-ruleset.xml/MockRule") ) ); assertEquals(1, rs.size()); @@ -858,7 +859,7 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { @Test void testWrongRuleNameReferenced() { assertCannotParse(rulesetXml( - ruleRef("net/sourceforge/pmd/TestRuleset1.xml/ThisRuleDoesNotExist") + ruleRef("net/sourceforge/pmd/rule/TestRuleset1.xml/ThisRuleDoesNotExist") )); } @@ -896,7 +897,7 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:schemaLocation=\"http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd\">\n" + " Custom ruleset for tests\n" - + " \n" + + " \n" + " \n" + " \n" + "\n"); assertEquals(4, ruleset.getRules().size()); @@ -997,7 +998,7 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { + " testdesc\n" + " \n" + + " ref=\"net/sourceforge/pmd/rule/TestRuleset1.xml/MockRule1\" message=\"TestMessageOverride\"> \n" + "\n" + " \n" + ""; @@ -1007,14 +1008,14 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { + "\n" + " testdesc\n" + " \n" + + " ref=\"net/sourceforge/pmd/rule/TestRuleset1.xml/FooMockRule1\"> \n" + " \n" + ""; private static final String REF_OVERRIDE_ORIGINAL_NAME_ONE_ELEM = "\n" + "\n" + " testdesc\n" - + " \n" + + " \n" + "\n" + ""; @@ -1022,7 +1023,7 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { + "\n" + " testdesc\n" + " \n" @@ -1042,7 +1043,7 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { + "\n" + " testdesc\n" + " \n" @@ -1088,7 +1089,7 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { + "\n" + + "ref=\"net/sourceforge/pmd/rule/TestRuleset1.xml/MockRule1\"/>\n" + " \n" + ""; @@ -1098,7 +1099,7 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { + "\n" + + "ref=\"net/sourceforge/pmd/rule/TestRuleset2.xml/TestRule\"/>\n" + " 2 \n" + "\n" + " 1 \n" @@ -1158,7 +1159,7 @@ class RuleSetFactoryTest extends RulesetFactoryTestBase { // Note: Update this RuleSet name to a different RuleSet with deprecated // Rules when the Rules are finally removed. - private static final String DEPRECATED_RULE_RULESET_NAME = "net/sourceforge/pmd/TestRuleset1.xml"; + private static final String DEPRECATED_RULE_RULESET_NAME = "net/sourceforge/pmd/rule/TestRuleset1.xml"; // Note: Update this Rule name to a different deprecated Rule when the one // listed here is finally removed. diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetReferenceIdTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetReferenceIdTest.java similarity index 99% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleSetReferenceIdTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetReferenceIdTest.java index 4e271dbbba..ac182bb402 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetReferenceIdTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetReferenceIdTest.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.rule; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.findAll; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetTest.java similarity index 96% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleSetTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetTest.java index ce0effc4d0..8c29db3399 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetTest.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.rule; import static net.sourceforge.pmd.PmdCoreTestUtils.dummyLanguage; import static net.sourceforge.pmd.PmdCoreTestUtils.dummyLanguage2; @@ -40,16 +40,19 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import net.sourceforge.pmd.DummyParsingHelper; +import net.sourceforge.pmd.FooRule; +import net.sourceforge.pmd.Report; import net.sourceforge.pmd.Report.ProcessingError; -import net.sourceforge.pmd.RuleSet.RuleSetBuilder; -import net.sourceforge.pmd.lang.DummyLanguageModule; +import net.sourceforge.pmd.RuleContext; +import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.ast.DummyNode.DummyRootNode; import net.sourceforge.pmd.lang.ast.Node; 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.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet.RuleSetBuilder; class RuleSetTest { @@ -573,25 +576,4 @@ class RuleSetTest { assertThat(report.getViolations(), hasSize(1)); } - - - static class MockRule extends net.sourceforge.pmd.lang.rule.MockRule { - - MockRule() { - super(); - setLanguage(DummyLanguageModule.getInstance()); - } - - MockRule(String name, String description, String message, String ruleSetName, RulePriority priority) { - super(name, description, message, ruleSetName, priority); - setLanguage(DummyLanguageModule.getInstance()); - } - - MockRule(String name, String description, String message, String ruleSetName) { - super(name, description, message, ruleSetName); - setLanguage(DummyLanguageModule.getInstance()); - } - - } - } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetWriterTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetWriterTest.java similarity index 97% rename from pmd-core/src/test/java/net/sourceforge/pmd/RuleSetWriterTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetWriterTest.java index b762837b10..0772737633 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetWriterTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RuleSetWriterTest.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.rule; import static net.sourceforge.pmd.util.CollectionUtil.mapOf; import static org.hamcrest.MatcherAssert.assertThat; @@ -18,9 +18,9 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.RuleSet.RuleSetBuilder; import net.sourceforge.pmd.lang.rule.RuleReference; import net.sourceforge.pmd.lang.rule.XPathRule; +import net.sourceforge.pmd.rule.RuleSet.RuleSetBuilder; import net.sourceforge.pmd.util.internal.xml.SchemaConstants; /** @@ -59,7 +59,7 @@ class RuleSetWriterTest extends RulesetFactoryTestBase { */ @Test void testWrite() throws Exception { - RuleSet braces = new RuleSetLoader().loadFromResource("net/sourceforge/pmd/TestRuleset1.xml"); + RuleSet braces = new RuleSetLoader().loadFromResource("net/sourceforge/pmd/rule/TestRuleset1.xml"); RuleSet ruleSet = new RuleSetBuilder(new Random().nextLong()) .withName("ruleset") .withDescription("ruleset description") diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RulesetFactoryTestBase.java b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RulesetFactoryTestBase.java similarity index 98% rename from pmd-core/src/test/java/net/sourceforge/pmd/RulesetFactoryTestBase.java rename to pmd-core/src/test/java/net/sourceforge/pmd/rule/RulesetFactoryTestBase.java index 33ad66894c..39c078b1a8 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RulesetFactoryTestBase.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/rule/RulesetFactoryTestBase.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.rule; import static net.sourceforge.pmd.util.CollectionUtil.buildMap; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -27,8 +27,9 @@ import org.mockito.verification.VerificationMode; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; +import net.sourceforge.pmd.PMDConfiguration; +import net.sourceforge.pmd.PmdAnalysis; import net.sourceforge.pmd.lang.DummyLanguageModule; -import net.sourceforge.pmd.rule.Rule; import net.sourceforge.pmd.util.internal.xml.SchemaConstant; import net.sourceforge.pmd.util.internal.xml.SchemaConstants; import net.sourceforge.pmd.util.log.MessageReporter; diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/TestRuleset1.xml b/pmd-core/src/test/resources/net/sourceforge/pmd/rule/TestRuleset1.xml similarity index 88% rename from pmd-core/src/test/resources/net/sourceforge/pmd/TestRuleset1.xml rename to pmd-core/src/test/resources/net/sourceforge/pmd/rule/TestRuleset1.xml index 8055258242..feb2f9396d 100644 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/TestRuleset1.xml +++ b/pmd-core/src/test/resources/net/sourceforge/pmd/rule/TestRuleset1.xml @@ -3,8 +3,8 @@ xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> - Ruleset used by test net.sourceforge.pmd.RuleSetWriter and RuleSetFactoryTest - + Ruleset used by test net.sourceforge.pmd.rule.RuleSetWriter and RuleSetFactoryTest + @@ -30,7 +30,7 @@ Just for test - + - + diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/TestRuleset2.xml b/pmd-core/src/test/resources/net/sourceforge/pmd/rule/TestRuleset2.xml similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/TestRuleset2.xml rename to pmd-core/src/test/resources/net/sourceforge/pmd/rule/TestRuleset2.xml diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/TestRuleset3.xml b/pmd-core/src/test/resources/net/sourceforge/pmd/rule/TestRuleset3.xml similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/TestRuleset3.xml rename to pmd-core/src/test/resources/net/sourceforge/pmd/rule/TestRuleset3.xml diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/TestRuleset4.xml b/pmd-core/src/test/resources/net/sourceforge/pmd/rule/TestRuleset4.xml similarity index 100% rename from pmd-core/src/test/resources/net/sourceforge/pmd/TestRuleset4.xml rename to pmd-core/src/test/resources/net/sourceforge/pmd/rule/TestRuleset4.xml diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/external-reference-ruleset.xml b/pmd-core/src/test/resources/net/sourceforge/pmd/rule/external-reference-ruleset.xml similarity index 87% rename from pmd-core/src/test/resources/net/sourceforge/pmd/external-reference-ruleset.xml rename to pmd-core/src/test/resources/net/sourceforge/pmd/rule/external-reference-ruleset.xml index 6515a57737..d9a32bbb12 100644 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/external-reference-ruleset.xml +++ b/pmd-core/src/test/resources/net/sourceforge/pmd/rule/external-reference-ruleset.xml @@ -3,8 +3,8 @@ xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> - Ruleset used by test net.sourceforge.pmd.RuleSetFactoryTest - + Ruleset used by test net.sourceforge.pmd.rule.RuleSetFactoryTest + diff --git a/pmd-core/src/test/resources/net/sourceforge/pmd/rulesets/reference-ruleset.xml b/pmd-core/src/test/resources/net/sourceforge/pmd/rule/reference-ruleset.xml similarity index 65% rename from pmd-core/src/test/resources/net/sourceforge/pmd/rulesets/reference-ruleset.xml rename to pmd-core/src/test/resources/net/sourceforge/pmd/rule/reference-ruleset.xml index aff963c994..962d1a8366 100644 --- a/pmd-core/src/test/resources/net/sourceforge/pmd/rulesets/reference-ruleset.xml +++ b/pmd-core/src/test/resources/net/sourceforge/pmd/rule/reference-ruleset.xml @@ -5,45 +5,45 @@ xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> - This ruleset checks my code for bad stuff + This ruleset checks my code for bad stuff. Used by net.sourceforge.pmd.rule.RuleSetFactoryTest. - + - + 2 - + - + - + - + 5 - + 2 - \ No newline at end of file + diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java index ebe55f4abd..3eb570bc1b 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java @@ -17,9 +17,9 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; -import net.sourceforge.pmd.RuleSet; -import net.sourceforge.pmd.RuleSetLoader; import net.sourceforge.pmd.internal.util.IOUtil; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoader; public final class GenerateRuleDocsCmd { diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java index 59c5635a0b..80af73520c 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java @@ -32,9 +32,6 @@ import org.apache.commons.text.StringEscapeUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import net.sourceforge.pmd.RuleSet; -import net.sourceforge.pmd.RuleSetLoadException; -import net.sourceforge.pmd.RuleSetLoader; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; @@ -42,6 +39,9 @@ import net.sourceforge.pmd.lang.rule.RuleReference; import net.sourceforge.pmd.lang.rule.XPathRule; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoadException; +import net.sourceforge.pmd.rule.RuleSetLoader; public class RuleDocGenerator { private static final Logger LOG = LoggerFactory.getLogger(RuleDocGenerator.class); diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java index f4b1d326ea..a575efd90a 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java @@ -10,10 +10,10 @@ import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.SystemUtils; -import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.rule.RuleReference; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet; public final class RuleSetUtils { diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java index bcec609c44..d514aac017 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java @@ -25,8 +25,8 @@ import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.representer.Representer; -import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.lang.Language; +import net.sourceforge.pmd.rule.RuleSet; public class SidebarGenerator { private static final String SIDEBAR_YML = "docs/_data/sidebars/pmd_sidebar.yml"; diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java index 69665c54b5..726b63120c 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java @@ -19,10 +19,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import net.sourceforge.pmd.RuleSet; -import net.sourceforge.pmd.RuleSetLoader; import net.sourceforge.pmd.docs.MockedFileWriter.FileEntry; import net.sourceforge.pmd.internal.util.IOUtil; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoader; class RuleDocGeneratorTest { diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java index f5baf81b34..6bfa114a1a 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java @@ -14,8 +14,8 @@ import java.util.List; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.RuleSetLoader; import net.sourceforge.pmd.internal.util.IOUtil; +import net.sourceforge.pmd.rule.RuleSetLoader; class RuleSetResolverTest { diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java index 8fe3a7d5ef..cdbce4d764 100644 --- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java +++ b/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java @@ -26,10 +26,10 @@ import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.representer.Representer; -import net.sourceforge.pmd.RuleSet; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; +import net.sourceforge.pmd.rule.RuleSet; class SidebarGeneratorTest { private MockedFileWriter writer = new MockedFileWriter(); diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java index 7205edf858..4e479ff041 100644 --- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java +++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.html; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional tests yet diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMD5RulesetTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMD5RulesetTest.java index 9334683d33..25714b6e53 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMD5RulesetTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMD5RulesetTest.java @@ -9,8 +9,8 @@ import static org.junit.jupiter.api.Assertions.assertNull; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.RuleSet; -import net.sourceforge.pmd.RuleSetLoader; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoader; class PMD5RulesetTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java index 2b7ffdc9fd..eb5b22ef17 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java @@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; -import net.sourceforge.pmd.RuleSet; -import net.sourceforge.pmd.RuleSetLoader; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoader; import com.github.stefanbirkner.systemlambda.SystemLambda; diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java index d6cafa265a..f11518cf1d 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.java; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; /** * Test java's rulesets diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java index 551b583deb..46a9adae40 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.ecmascript; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; /** * Test javascript's rulesets diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java index 80b8ecbf7a..df499f7f42 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.jsp; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; /** * Test jsp's rulesets diff --git a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/RuleSetFactoryTest.java b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/RuleSetFactoryTest.java index 9655674f8a..3faa6b6ab2 100644 --- a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/RuleSetFactoryTest.java +++ b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.kotlin; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional tests yet 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 6636e487a6..4b00719190 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 @@ -17,6 +17,7 @@ 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.rule.Rule +import net.sourceforge.pmd.rule.RuleSet import java.io.InputStream import java.nio.charset.StandardCharsets import java.nio.file.Files diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/RuleSetFactoryTest.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/RuleSetFactoryTest.java index d515ff6597..6932fa08a1 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/RuleSetFactoryTest.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.modelica; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional tests yet diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/RuleSetFactoryTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/RuleSetFactoryTest.java index 2fa3b962eb..59518c00bd 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/RuleSetFactoryTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.plsql; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; /** * Test plsql's rulesets diff --git a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/RulesetFactoryTest.java b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/RulesetFactoryTest.java index ff8a253296..93ac55200c 100644 --- a/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/RulesetFactoryTest.java +++ b/pmd-scala-modules/pmd-scala-common/src/test/java/net/sourceforge/pmd/lang/scala/RulesetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.scala; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; /** * Test scala rulesets diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/RuleSetFactoryTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/RuleSetFactoryTest.java index f800ac2bea..bd9fb82f51 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/RuleSetFactoryTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.swift; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { // no additional unit tests diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractLanguageVersionTest.java b/pmd-test/src/main/java/net/sourceforge/pmd/AbstractLanguageVersionTest.java index 54f0b83b6f..c3eed72f00 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractLanguageVersionTest.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/AbstractLanguageVersionTest.java @@ -19,6 +19,8 @@ import net.sourceforge.pmd.ant.SourceLanguage; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.LanguageVersion; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoader; /** * Base test class for {@link LanguageVersion} implementations.
diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java b/pmd-test/src/main/java/net/sourceforge/pmd/rule/AbstractRuleSetFactoryTest.java similarity index 99% rename from pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java rename to pmd-test/src/main/java/net/sourceforge/pmd/rule/AbstractRuleSetFactoryTest.java index 6b6e04c25b..067e1cd78a 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/rule/AbstractRuleSetFactoryTest.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.rule; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.emptyString; @@ -48,7 +48,6 @@ import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.rule.RuleReference; import net.sourceforge.pmd.lang.rule.XPathRule; import net.sourceforge.pmd.properties.PropertyDescriptor; -import net.sourceforge.pmd.rule.Rule; import net.sourceforge.pmd.util.log.internal.MessageReporterBase; /** 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 46443793b2..08d48ff1e7 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 @@ -27,9 +27,6 @@ import org.xml.sax.InputSource; import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; import net.sourceforge.pmd.Report; -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; @@ -38,6 +35,9 @@ import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.renderers.TextRenderer; import net.sourceforge.pmd.reporting.GlobalAnalysisListener; import net.sourceforge.pmd.rule.Rule; +import net.sourceforge.pmd.rule.RuleSet; +import net.sourceforge.pmd.rule.RuleSetLoadException; +import net.sourceforge.pmd.rule.RuleSetLoader; 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-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java index 3b020f99b1..ff5782044f 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/RuleSetFactoryTest.java @@ -4,8 +4,8 @@ package net.sourceforge.pmd.lang.vf; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; class RuleSetFactoryTest extends AbstractRuleSetFactoryTest { RuleSetFactoryTest() { diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java index 75037cd663..987532babc 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.vm; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; /** * Test velocity's rulesets. diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/RuleSetFactoryTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/RuleSetFactoryTest.java index b2c4b70e68..9b9934c738 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/RuleSetFactoryTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/RuleSetFactoryTest.java @@ -4,7 +4,7 @@ package net.sourceforge.pmd.lang.xml; -import net.sourceforge.pmd.AbstractRuleSetFactoryTest; +import net.sourceforge.pmd.rule.AbstractRuleSetFactoryTest; /** * Test xml's and xslt's rulesets