From 84c5887f8867712f6c7cd4353e48a05e0cca98f8 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Tue, 19 Jul 2022 20:40:39 +0200 Subject: [PATCH 01/13] [doc] Fix missing additional rulesets Fixes #4051 --- docs/pages/release_notes.md | 1 + .../net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java | 9 +++++---- .../net/sourceforge/pmd/docs/RuleSetResolverTest.java | 9 +++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 56690a23a0..2084697dbf 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -43,6 +43,7 @@ Being based on a proper Antlr grammar, CPD can: ### Fixed Issues * core * [#4031](https://github.com/pmd/pmd/issues/4031): \[core] If report is written to stdout, stdout should not be closed + * [#4051](https://github.com/pmd/pmd/issues/4051): \[doc] Additional rulesets are not listed in documentation * java * [#4015](https://github.com/pmd/pmd/issues/4015): \[java] Support JDK 19 * java-bestpractices 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 d5b3002a6b..b434d4e8f5 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 @@ -47,16 +47,17 @@ public final class GenerateRuleDocsCmd { System.out.println("Generated docs in " + (System.currentTimeMillis() - start) + " ms"); } + static final Pattern ADDITIONAL_RULESET_PATTERN = Pattern.compile("^.+" + Pattern.quote(File.separator) + "pmd-\\w+" + + Pattern.quote(IOUtil.normalizePath(File.separator + Paths.get("src", "main", "resources", "rulesets").toString()) + File.separator) + + "\\w+" + Pattern.quote(File.separator) + "\\w+.xml$"); + public static List findAdditionalRulesets(Path basePath) { try { List additionalRulesets = new ArrayList<>(); - Pattern rulesetPattern = Pattern.compile("^.+" + Pattern.quote(File.separator) + "pmd-\\w+" - + Pattern.quote(IOUtil.normalizePath(File.separator + Paths.get("src", "main", "resources", "rulesets").toString() + File.separator)) - + "\\w+" + Pattern.quote(File.separator) + "\\w+.xml$"); Files.walkFileTree(basePath, new SimpleFileVisitor() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - if (rulesetPattern.matcher(file.toString()).matches()) { + if (ADDITIONAL_RULESET_PATTERN.matcher(file.toString()).matches()) { additionalRulesets.add(file.toString()); } 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 3d85da8daa..7894f8c97f 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 @@ -4,6 +4,8 @@ package net.sourceforge.pmd.docs; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.nio.file.FileSystems; @@ -34,6 +36,8 @@ public class RuleSetResolverTest { filterRuleSets(additionalRulesets); + assertFalse(additionalRulesets.isEmpty()); + RuleSetFactory ruleSetFactory = RulesetsFactoryUtils.defaultFactory(); for (String filename : additionalRulesets) { try { @@ -44,6 +48,11 @@ public class RuleSetResolverTest { } } + @Test + public void testAdditionalRulesetPattern() { + assertTrue(GenerateRuleDocsCmd.ADDITIONAL_RULESET_PATTERN.matcher("/home/foo/pmd/pmd-java/src/main/resources/rulesets/java/quickstart.xml").matches()); + } + private void filterRuleSets(List additionalRulesets) { Iterator it = additionalRulesets.iterator(); while (it.hasNext()) { From c31278504c1daad06af61daa62fc0b33652ba7a7 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 21 Jul 2022 10:53:50 +0200 Subject: [PATCH 02/13] Fix test under Windows --- .../java/net/sourceforge/pmd/docs/RuleSetResolverTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 7894f8c97f..bafaed3623 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 @@ -50,7 +50,8 @@ public class RuleSetResolverTest { @Test public void testAdditionalRulesetPattern() { - assertTrue(GenerateRuleDocsCmd.ADDITIONAL_RULESET_PATTERN.matcher("/home/foo/pmd/pmd-java/src/main/resources/rulesets/java/quickstart.xml").matches()); + String filePath = IOUtil.normalizePath("/home/foo/pmd/pmd-java/src/main/resources/rulesets/java/quickstart.xml"); + assertTrue(GenerateRuleDocsCmd.ADDITIONAL_RULESET_PATTERN.matcher(filePath).matches()); } private void filterRuleSets(List additionalRulesets) { From bf5828d7d176d493d165589e497c350257efd748 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 28 Jul 2022 14:59:08 +0200 Subject: [PATCH 03/13] [doc] Fix jdoc link in release notes --- docs/pages/release_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index b45e8879f0..a41cae583f 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -88,7 +88,7 @@ Being based on a proper Antlr grammar, CPD can: but it is no longer supported with Java 19 Preview. * The interface {% jdoc core::cpd.renderer.CPDRenderer %} is deprecated. For custom CPD renderers the new interface {% jdoc core::cpd.renderer.CPDReportRenderer %} should be used. -* The class {% jdoc test::testframework.TestDescriptor %} is deprecated, replaced with {% jdoc test-schema::testframework.RuleTestDescriptor %}. +* The class {% jdoc test::testframework.TestDescriptor %} is deprecated, replaced with {% jdoc test-schema::test.schema.RuleTestDescriptor %}. * Many methods of {% jdoc test::testframework.RuleTst %} have been deprecated as internal API. #### Experimental APIs From ee38e7d81a0733b18da23a61c9558d90016b602b Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 29 Jul 2022 10:11:35 +0200 Subject: [PATCH 04/13] [core] Add "--debug" flag for CPD Fixes #3796 --- docs/pages/pmd/userdocs/cpd/cpd.md | 3 ++ docs/pages/release_notes.md | 6 ++++ .../java/net/sourceforge/pmd/cpd/CPD.java | 16 ++++++++++ .../sourceforge/pmd/cpd/CPDConfiguration.java | 13 ++++++++ .../pmd/cpd/CPDCommandLineInterfaceTest.java | 32 ++++++++++++++++--- 5 files changed, 65 insertions(+), 5 deletions(-) diff --git a/docs/pages/pmd/userdocs/cpd/cpd.md b/docs/pages/pmd/userdocs/cpd/cpd.md index d909eb4f2f..67b81492be 100644 --- a/docs/pages/pmd/userdocs/cpd/cpd.md +++ b/docs/pages/pmd/userdocs/cpd/cpd.md @@ -73,6 +73,9 @@ Novice as much as advanced readers may want to [read on on Refactoring Guru](htt description="Sources code language." default="java" %} + {% include custom/cli_option_row.html options="--debug,--verbose" + description="Debug mode. Prints more log output." + %} {% include custom/cli_option_row.html options="--encoding" description="Character encoding to use when processing files. If not specified, CPD uses the system default encoding." %} diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index a41cae583f..dc7f15c512 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -44,6 +44,7 @@ Being based on a proper Antlr grammar, CPD can: * apex * [#4056](https://github.com/pmd/pmd/pull/4056): \[apex] ApexSOQLInjection: Add support count query * core + * [#3796](https://github.com/pmd/pmd/issues/3796): \[core] CPD should also provide a `--debug` flag * [#4021](https://github.com/pmd/pmd/pull/4021): \[core] CPD: Add total number of tokens to XML reports * [#4031](https://github.com/pmd/pmd/issues/4031): \[core] If report is written to stdout, stdout should not be closed * [#4051](https://github.com/pmd/pmd/issues/4051): \[doc] Additional rulesets are not listed in documentation @@ -66,6 +67,11 @@ Being based on a proper Antlr grammar, CPD can: ### API Changes +#### CPD CLI + +* CPD has a new CLI option `--debug`. This option has the same behavior as in PMD. It enables more verbose + logging output. + #### Rule Test Framework * The module "pmd-test", which contains support classes to write rule tests, now **requires Java 8**. If you depend on diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPD.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPD.java index 0ffc7b397d..b7a39e7112 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPD.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPD.java @@ -16,6 +16,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeMap; +import java.util.logging.ConsoleHandler; import java.util.logging.Level; import java.util.logging.Logger; @@ -28,6 +29,7 @@ import net.sourceforge.pmd.util.IOUtil; import net.sourceforge.pmd.util.database.DBMSMetadata; import net.sourceforge.pmd.util.database.DBURI; import net.sourceforge.pmd.util.database.SourceObject; +import net.sourceforge.pmd.util.log.ScopedLogHandlersManager; public class CPD { private static final Logger LOGGER = Logger.getLogger(CPD.class.getName()); @@ -54,8 +56,10 @@ public class CPD { } public void go() { + LOGGER.fine("Running match algorithm on " + source.size() + " files..."); matchAlgorithm = new MatchAlgorithm(source, tokens, configuration.getMinimumTileSize(), listener); matchAlgorithm.findMatches(); + LOGGER.fine("Finished: " + matchAlgorithm.getMatches().size() + " duplicates found"); } public Iterator getMatches() { @@ -80,6 +84,7 @@ public class CPD { if (!dir.exists()) { throw new FileNotFoundException("Couldn't find directory " + dir); } + LOGGER.fine("Searching directory " + dir + " for files"); FileFinder finder = new FileFinder(); // TODO - could use SourceFileSelector here add(finder.findFilesFrom(dir, configuration.filenameFilter(), recurse)); @@ -145,6 +150,7 @@ public class CPD { } private void addAndThrowLexicalError(SourceCode sourceCode) throws IOException { + LOGGER.fine("Tokenizing " + sourceCode.getFileName()); configuration.tokenizer().tokenize(sourceCode, tokens); listener.addedFile(1, new File(sourceCode.getFileName())); source.put(sourceCode.getFileName(), sourceCode); @@ -206,6 +212,13 @@ public class CPD { return statusCode; } + final Level logLevel = arguments.isDebug() ? Level.FINER : Level.INFO; + final ScopedLogHandlersManager logHandlerManager = new ScopedLogHandlersManager(logLevel, new ConsoleHandler()); + final Level oldLogLevel = LOGGER.getLevel(); + // Need to do this, since the static logger has already been initialized + // at this point + LOGGER.setLevel(logLevel); + CPD cpd = new CPD(arguments); try { @@ -233,6 +246,9 @@ public class CPD { e.printStackTrace(); LOGGER.severe(CliMessages.errorDetectedMessage(1, CPDCommandLineInterface.PROGRAM_NAME)); statusCode = StatusCode.ERROR; + } finally { + logHandlerManager.close(); + LOGGER.setLevel(oldLogLevel); } return statusCode; } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java index abda86e5e0..82906e807b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java @@ -141,6 +141,9 @@ public class CPDConfiguration extends AbstractConfiguration { description = "By default CPD exits with status 4 if code duplications are found. Disable this option with '-failOnViolation false' to exit with 0 instead and just write the report.") private boolean failOnViolation = true; + @Parameter(names = { "--debug", "--verbose" }, description = "Debug mode.") + private boolean debug = false; + // this has to be a public static class, so that JCommander can use it! public static class LanguageConverter implements IStringConverter { @@ -540,4 +543,14 @@ public class CPDConfiguration extends AbstractConfiguration { public void setFailOnViolation(boolean failOnViolation) { this.failOnViolation = failOnViolation; } + + @Override + public boolean isDebug() { + return debug; + } + + @Override + public void setDebug(boolean debug) { + this.debug = debug; + } } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java index ce680e4c5b..9dcabdc35a 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java @@ -4,6 +4,7 @@ package net.sourceforge.pmd.cpd; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -17,9 +18,9 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import org.junit.Assert; import org.junit.Rule; import org.junit.Test; +import org.junit.contrib.java.lang.system.SystemErrRule; import org.junit.contrib.java.lang.system.SystemOutRule; import org.junit.rules.TemporaryFolder; @@ -39,6 +40,10 @@ public class CPDCommandLineInterfaceTest { @Rule public final SystemOutRule log = new SystemOutRule().enableLog().muteForSuccessfulTests(); + + @Rule + public final SystemErrRule errLog = new SystemErrRule().enableLog().muteForSuccessfulTests(); + @Rule public final JavaUtilLoggingRule loggingRule = new JavaUtilLoggingRule(PMD.class.getPackage().getName()).mute(); @Rule @@ -65,8 +70,8 @@ public class CPDCommandLineInterfaceTest { CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--files", SRC_DIR, "--format", "xml"); final String expectedFilesXml = getExpectedFileEntriesXml(NUMBER_OF_TOKENS.keySet()); - Assert.assertEquals(CPD.StatusCode.OK, statusCode); - Assert.assertEquals("" + "\n" + "" + "\n" + expectedFilesXml + "", log.getLog()); + assertEquals(CPD.StatusCode.OK, statusCode); + assertEquals("" + "\n" + "" + "\n" + expectedFilesXml + "", log.getLog()); } @Test @@ -80,12 +85,29 @@ public class CPDCommandLineInterfaceTest { CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--filelist", filelist.toAbsolutePath().toString(), "--format", "xml", "-failOnViolation", "true"); - Assert.assertEquals(CPD.StatusCode.OK, statusCode); - Assert.assertEquals("" + "\n" + "" + "\n" + expectedFilesXml + "", log.getLog()); + assertEquals(CPD.StatusCode.OK, statusCode); + assertEquals("" + "\n" + "" + "\n" + expectedFilesXml + "", log.getLog()); assertTrue(loggingRule.getLog().contains("Some deprecated options were used on the command-line, including -failOnViolation")); assertTrue(loggingRule.getLog().contains("Consider replacing it with --fail-on-violation")); // only one parameter is logged assertFalse(loggingRule.getLog().contains("Some deprecated options were used on the command-line, including --filelist")); assertFalse(loggingRule.getLog().contains("Consider replacing it with --file-list")); } + + @Test + public void testDebugLogging() { + CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--files", + SRC_DIR, "--debug"); + assertEquals(CPD.StatusCode.OK, statusCode); + assertTrue(errLog.getLog().contains("Tokenizing ")); // this is a debug logging + } + + @Test + public void testNormalLogging() { + loggingRule.clear(); + CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--files", + SRC_DIR); + assertEquals(CPD.StatusCode.OK, statusCode); + assertFalse(errLog.getLog().contains("Tokenizing ")); // this is a debug logging + } } From a36032b2bfab942ba8949808de217aa29950baca Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 29 Jul 2022 12:33:43 +0200 Subject: [PATCH 05/13] Fixups from review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Fournier --- .../sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java index 9dcabdc35a..a01b355b7d 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java @@ -4,6 +4,9 @@ package net.sourceforge.pmd.cpd; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -99,7 +102,7 @@ public class CPDCommandLineInterfaceTest { CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--files", SRC_DIR, "--debug"); assertEquals(CPD.StatusCode.OK, statusCode); - assertTrue(errLog.getLog().contains("Tokenizing ")); // this is a debug logging + assertThat(errLog.getLog(), containsString("Tokenizing ")); // this is a debug logging } @Test @@ -108,6 +111,6 @@ public class CPDCommandLineInterfaceTest { CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--files", SRC_DIR); assertEquals(CPD.StatusCode.OK, statusCode); - assertFalse(errLog.getLog().contains("Tokenizing ")); // this is a debug logging + assertThat(errLog.getLog(), not(containsString("Tokenizing "))); // this is a debug logging } } From 6128631acb420119b65126273db3a5013ff09729 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 30 Jul 2022 09:59:57 +0200 Subject: [PATCH 06/13] [doc] Add SPONSORS.md --- SPONSORS.md | 10 ++++++++++ docs/pages/release_notes.md | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 SPONSORS.md diff --git a/SPONSORS.md b/SPONSORS.md new file mode 100644 index 0000000000..4bbe1c7b55 --- /dev/null +++ b/SPONSORS.md @@ -0,0 +1,10 @@ +# PMD's sponsors + +Many thanks to all our sponsors: + +* [Matt Hargett](https://github.com/matthargett) (@matthargett) + +If you also want to sponsor PMD, you have two options: + +* [Sponsor @pmd on GitHub Sponsors](https://github.com/sponsors/pmd) +* [PMD - Open Collective](https://opencollective.com/pmd) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index a41cae583f..7a305420e2 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -112,6 +112,12 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr * {%jdoc !!core::cpd.CPDConfiguration#getCPDRendererFromString(java.lang.String,java.lang.String) %} * {%jdoc core::cpd.renderer.CPDRendererAdapter %} +### Financial Contributions + +Many thanks to our sponsors: + +* [Matt Hargett](https://github.com/matthargett) (@matthargett) + ### External Contributions * [#3984](https://github.com/pmd/pmd/pull/3984): \[java] Fix AddEmptyString false-negative issue - [@LiGaOg](https://github.com/LiGaOg) * [#3988](https://github.com/pmd/pmd/pull/3988): \[java] Modify WhileLoopWithLiteralBoolean to meet the missing case #3455 - [@VoidxHoshi](https://github.com/VoidxHoshi) From 143545c39001d5ec666677ada10004d90b3ea56d Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 30 Jul 2022 11:23:41 +0200 Subject: [PATCH 07/13] Prepare pmd release 6.48.0 --- docs/_config.yml | 2 +- docs/pages/next_major_development.md | 53 ++++++++++++++++++++++++++++ docs/pages/release_notes.md | 5 +++ 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index a75b2e740a..5ccd6a03b2 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,7 +1,7 @@ repository: pmd/pmd pmd: - version: 6.48.0-SNAPSHOT + version: 6.48.0 previous_version: 6.47.0 date: 30-July-2022 release_type: minor diff --git a/docs/pages/next_major_development.md b/docs/pages/next_major_development.md index 6c53ffc407..5cc83709eb 100644 --- a/docs/pages/next_major_development.md +++ b/docs/pages/next_major_development.md @@ -125,6 +125,59 @@ the breaking API changes will be performed in 7.0.0. an API is tagged as `@Deprecated` or not in the latest minor release. During the development of 7.0.0, we may decide to remove some APIs that were not tagged as deprecated, though we'll try to avoid it." %} +#### 6.48.0 + +##### CPD CLI + +* CPD has a new CLI option `--debug`. This option has the same behavior as in PMD. It enables more verbose + logging output. + +##### Rule Test Framework + +* The module "pmd-test", which contains support classes to write rule tests, now **requires Java 8**. If you depend on + this module for testing your own custom rules, you'll need to make sure to use at least Java 8. +* The new module "pmd-test-schema" contains now the XSD schema and the code to parse the rule test XML files. The + schema has been extracted in order to easily share it with other tools like the Rule Designer or IDE plugins. +* Test schema changes: + * The attribute `isRegressionTest` of `test-code` is deprecated. The new + attribute `disabled` should be used instead for defining whether a rule test should be skipped or not. + * The attributes `reinitializeRule` and `useAuxClasspath` of `test-code` are deprecated and assumed true. + They will not be replaced. + * The new attribute `focused` of `test-code` allows disabling all tests except the focused one temporarily. +* More information about the rule test framework can be found in the documentation: + [Testing your rules](pmd_userdocs_extending_testing.html) + +##### Deprecated API + +* The experimental Java AST class {% jdoc java::lang.java.ast.ASTGuardedPattern %} has been deprecated and + will be removed. It was introduced for Java 17 and Java 18 Preview as part of pattern matching for switch, + but it is no longer supported with Java 19 Preview. +* The interface {% jdoc core::cpd.renderer.CPDRenderer %} is deprecated. For custom CPD renderers + the new interface {% jdoc core::cpd.renderer.CPDReportRenderer %} should be used. +* The class {% jdoc test::testframework.TestDescriptor %} is deprecated, replaced with {% jdoc test-schema::test.schema.RuleTestDescriptor %}. +* Many methods of {% jdoc test::testframework.RuleTst %} have been deprecated as internal API. + +##### Experimental APIs + +* To support the Java preview language features "Pattern Matching for Switch" and "Record Patterns", the following + AST nodes have been introduced as experimental: + * {% jdoc java::lang.java.ast.ASTSwitchGuard %} + * {% jdoc java::lang.java.ast.ASTRecordPattern %} + * {% jdoc java::lang.java.ast.ASTComponentPatternList %} + +##### Internal API + +Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0. +You can identify them with the `@InternalApi` annotation. You'll also get a deprecation warning. + +* {%jdoc !!core::cpd.CPDConfiguration#setRenderer(net.sourceforge.pmd.cpd.Renderer) %} +* {%jdoc !!core::cpd.CPDConfiguration#setCPDRenderer(net.sourceforge.pmd.cpd.renderer.CPDRenderer) %} +* {%jdoc !!core::cpd.CPDConfiguration#getRenderer() %} +* {%jdoc !!core::cpd.CPDConfiguration#getCPDRenderer() %} +* {%jdoc !!core::cpd.CPDConfiguration#getRendererFromString(java.lang.String,java.lang.String) %} +* {%jdoc !!core::cpd.CPDConfiguration#getCPDRendererFromString(java.lang.String,java.lang.String) %} +* {%jdoc core::cpd.renderer.CPDRendererAdapter %} + #### 6.47.0 No changes. diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e809b82300..eeabe3a7dc 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -134,5 +134,10 @@ Many thanks to our sponsors: * [#4056](https://github.com/pmd/pmd/pull/4056): \[apex] ApexSOQLInjection: Add support count query - [@gwilymatgearset](https://github.com/gwilymatgearset) * [#4061](https://github.com/pmd/pmd/pull/4061): \[lua] Fix several related Lua parsing issues found when using CPD - [@matthargett](https://github.com/matthargett) +### Stats +* 102 commits +* 26 closed tickets & PRs +* Days since last release: 35 + {% endtocmaker %} From 6aa2b47f2ed64c2971dd86a44bb4fb62456e728c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 30 Jul 2022 11:35:53 +0200 Subject: [PATCH 08/13] [maven-release-plugin] prepare release pmd_releases/6.48.0 --- pmd-apex-jorje/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-core/pom.xml | 2 +- pmd-cpp/pom.xml | 2 +- pmd-cs/pom.xml | 2 +- pmd-dart/pom.xml | 2 +- pmd-dist/pom.xml | 2 +- pmd-doc/pom.xml | 2 +- pmd-fortran/pom.xml | 2 +- pmd-gherkin/pom.xml | 2 +- pmd-go/pom.xml | 2 +- pmd-groovy/pom.xml | 2 +- pmd-html/pom.xml | 2 +- pmd-java/pom.xml | 2 +- pmd-java8/pom.xml | 2 +- pmd-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-lua/pom.xml | 2 +- pmd-matlab/pom.xml | 2 +- pmd-modelica/pom.xml | 2 +- pmd-objectivec/pom.xml | 2 +- pmd-perl/pom.xml | 2 +- pmd-php/pom.xml | 2 +- pmd-plsql/pom.xml | 2 +- pmd-python/pom.xml | 2 +- pmd-ruby/pom.xml | 2 +- pmd-scala-modules/pmd-scala-common/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.12/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.13/pom.xml | 2 +- pmd-scala/pom.xml | 2 +- pmd-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 6 ++---- pmd-test/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-vm/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 8 ++++---- 39 files changed, 43 insertions(+), 45 deletions(-) diff --git a/pmd-apex-jorje/pom.xml b/pmd-apex-jorje/pom.xml index c368f726dc..c605e61a9d 100644 --- a/pmd-apex-jorje/pom.xml +++ b/pmd-apex-jorje/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index 5a5f208f72..a661b0e3c8 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index d7bf9e1b27..4ef2c6c1c1 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index cfbe955501..839b79e061 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index 36a4e08e0a..b6169ce0f5 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index e3c472c466..4b29f14fbc 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index c41b723273..0624ab525a 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index f35338c8c1..1dd433f596 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index 55afe0f0ca..c26c301c30 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index e49be3647b..20eda17f8a 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index 9c7c525e53..febadeb629 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index db176baebe..5fea6def0c 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index db21698140..381b86a9a0 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index ddd74247e6..ac5a921e0e 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-java8/pom.xml b/pmd-java8/pom.xml index a122fd7a41..47a06c8528 100644 --- a/pmd-java8/pom.xml +++ b/pmd-java8/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index 1fb34e70f5..844634afde 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index 2689d0b071..c027744cf0 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 4e226a123d..4e58d15787 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index b8c6d65a03..1d499c152a 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index 180aa92f43..b5505b035e 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index af78df7ea9..30e061f46b 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 72480f6f5a..48bfa8a679 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index fca206b41e..93a391f0f6 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index a3a95bb798..cf0886bd93 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index 029be6c047..6f772c36bb 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index c217149637..d3bbc1bc3b 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index 7a4c58569d..ec6c5e4c30 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index 6631300aa5..532e67da47 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index 5029a7d0a3..b303122d0c 100644 --- a/pmd-scala-modules/pmd-scala-common/pom.xml +++ b/pmd-scala-modules/pmd-scala-common/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../../pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.12/pom.xml b/pmd-scala-modules/pmd-scala_2.12/pom.xml index 2de4376841..eadca460a0 100644 --- a/pmd-scala-modules/pmd-scala_2.12/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.12/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 6.48.0-SNAPSHOT + 6.48.0 ../pmd-scala-common/pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.13/pom.xml b/pmd-scala-modules/pmd-scala_2.13/pom.xml index a7e7e17bed..1468d708b5 100644 --- a/pmd-scala-modules/pmd-scala_2.13/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.13/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 6.48.0-SNAPSHOT + 6.48.0 ../pmd-scala-common/pom.xml diff --git a/pmd-scala/pom.xml b/pmd-scala/pom.xml index 513cbc7fda..bdd29afbab 100644 --- a/pmd-scala/pom.xml +++ b/pmd-scala/pom.xml @@ -9,7 +9,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 9a600748c1..f19edbaa50 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index e1dacde506..2f15a89727 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -1,7 +1,5 @@ - + 4.0.0 pmd-test-schema PMD Test Schema @@ -13,7 +11,7 @@ pmd net.sourceforge.pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index a161cf6458..594a0619fa 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index 6285b89b29..de6d255a9a 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-vm/pom.xml b/pmd-vm/pom.xml index 238203f2f0..3e1e175787 100644 --- a/pmd-vm/pom.xml +++ b/pmd-vm/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index c3ade37bbd..58804856eb 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 ../pom.xml diff --git a/pom.xml b/pom.xml index 065b719b70..91a7b0c728 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 6.48.0-SNAPSHOT + 6.48.0 pom PMD @@ -55,7 +55,7 @@ scm:git:git://github.com/pmd/pmd.git scm:git:ssh://git@github.com/pmd/pmd.git https://github.com/pmd/pmd - HEAD + pmd_releases/6.48.0 @@ -76,7 +76,7 @@ - 2022-06-25T07:30:42Z + 2022-07-30T09:23:49Z 7 @@ -104,7 +104,7 @@ https://pmd.github.io/pmd -Xmx512m -Dfile.encoding=${project.build.sourceEncoding} ${extraArgLine} - + 18 From 995d00fde3a692905f0d60759e90d05695bdb19c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 30 Jul 2022 11:35:57 +0200 Subject: [PATCH 09/13] [maven-release-plugin] prepare for next development iteration --- pmd-apex-jorje/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-core/pom.xml | 2 +- pmd-cpp/pom.xml | 2 +- pmd-cs/pom.xml | 2 +- pmd-dart/pom.xml | 2 +- pmd-dist/pom.xml | 2 +- pmd-doc/pom.xml | 2 +- pmd-fortran/pom.xml | 2 +- pmd-gherkin/pom.xml | 2 +- pmd-go/pom.xml | 2 +- pmd-groovy/pom.xml | 2 +- pmd-html/pom.xml | 2 +- pmd-java/pom.xml | 2 +- pmd-java8/pom.xml | 2 +- pmd-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-lua/pom.xml | 2 +- pmd-matlab/pom.xml | 2 +- pmd-modelica/pom.xml | 2 +- pmd-objectivec/pom.xml | 2 +- pmd-perl/pom.xml | 2 +- pmd-php/pom.xml | 2 +- pmd-plsql/pom.xml | 2 +- pmd-python/pom.xml | 2 +- pmd-ruby/pom.xml | 2 +- pmd-scala-modules/pmd-scala-common/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.12/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.13/pom.xml | 2 +- pmd-scala/pom.xml | 2 +- pmd-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 2 +- pmd-test/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-vm/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 6 +++--- 39 files changed, 41 insertions(+), 41 deletions(-) diff --git a/pmd-apex-jorje/pom.xml b/pmd-apex-jorje/pom.xml index c605e61a9d..9d82fcc6e2 100644 --- a/pmd-apex-jorje/pom.xml +++ b/pmd-apex-jorje/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index a661b0e3c8..64d14d5a86 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index 4ef2c6c1c1..f43367694a 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 839b79e061..6f3d3afcee 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index b6169ce0f5..345f57f90b 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index 4b29f14fbc..8989f246ce 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 0624ab525a..c5912ee704 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 1dd433f596..d53987ee65 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index c26c301c30..c092b17d49 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index 20eda17f8a..047f06705d 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index febadeb629..8fff13187f 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index 5fea6def0c..4f04a88d66 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index 381b86a9a0..70c45debaa 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index ac5a921e0e..1f0ca4dae9 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-java8/pom.xml b/pmd-java8/pom.xml index 47a06c8528..6a4c97c7c6 100644 --- a/pmd-java8/pom.xml +++ b/pmd-java8/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index 844634afde..0c58e2aef2 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index c027744cf0..14f1f6d76b 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 4e58d15787..125ac5cdc0 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index 1d499c152a..f53f195b22 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index b5505b035e..f342207fd0 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index 30e061f46b..be40507861 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 48bfa8a679..72b7a50b8f 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index 93a391f0f6..4aee2cf7dc 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index cf0886bd93..9a44d3d7d7 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index 6f772c36bb..af01ee2f6f 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index d3bbc1bc3b..b3cf518cce 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index ec6c5e4c30..9c30438d09 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index 532e67da47..62b5d6b15b 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index b303122d0c..14ac1f8367 100644 --- a/pmd-scala-modules/pmd-scala-common/pom.xml +++ b/pmd-scala-modules/pmd-scala-common/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../../pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.12/pom.xml b/pmd-scala-modules/pmd-scala_2.12/pom.xml index eadca460a0..61ac0b7d84 100644 --- a/pmd-scala-modules/pmd-scala_2.12/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.12/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 6.48.0 + 6.49.0-SNAPSHOT ../pmd-scala-common/pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.13/pom.xml b/pmd-scala-modules/pmd-scala_2.13/pom.xml index 1468d708b5..6bf91dcd09 100644 --- a/pmd-scala-modules/pmd-scala_2.13/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.13/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 6.48.0 + 6.49.0-SNAPSHOT ../pmd-scala-common/pom.xml diff --git a/pmd-scala/pom.xml b/pmd-scala/pom.xml index bdd29afbab..c12939498b 100644 --- a/pmd-scala/pom.xml +++ b/pmd-scala/pom.xml @@ -9,7 +9,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index f19edbaa50..43699a38b0 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index 2f15a89727..5bb6d34c03 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -11,7 +11,7 @@ pmd net.sourceforge.pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index 594a0619fa..50e48f3a30 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index de6d255a9a..f66ecc00cb 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-vm/pom.xml b/pmd-vm/pom.xml index 3e1e175787..597785ae98 100644 --- a/pmd-vm/pom.xml +++ b/pmd-vm/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index 58804856eb..3b5e97f73e 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 91a7b0c728..aef9c8a492 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 6.48.0 + 6.49.0-SNAPSHOT pom PMD @@ -55,7 +55,7 @@ scm:git:git://github.com/pmd/pmd.git scm:git:ssh://git@github.com/pmd/pmd.git https://github.com/pmd/pmd - pmd_releases/6.48.0 + HEAD @@ -76,7 +76,7 @@ - 2022-07-30T09:23:49Z + 2022-07-30T09:35:57Z 7 From 77e3bab4a62f33834c76970a8d177b48aab9125b Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 30 Jul 2022 11:38:19 +0200 Subject: [PATCH 10/13] Prepare next development version [skip ci] --- docs/_config.yml | 6 +- docs/pages/release_notes.md | 119 ------------------------- docs/pages/release_notes_old.md | 149 ++++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+), 122 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index 5ccd6a03b2..75b1ae16eb 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,9 +1,9 @@ repository: pmd/pmd pmd: - version: 6.48.0 - previous_version: 6.47.0 - date: 30-July-2022 + version: 6.49.0-SNAPSHOT + previous_version: 6.48.0 + date: 31-August-2022 release_type: minor # release types: major, minor, bugfix diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index eeabe3a7dc..b8f8783555 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -14,130 +14,11 @@ This is a {{ site.pmd.release_type }} release. ### New and noteworthy -#### Java 19 Support - -This release of PMD brings support for Java 19. There are no new standard language features. - -PMD supports [JEP 427: Pattern Matching for switch (Third Preview)](https://openjdk.org/jeps/427) and -[JEP 405: Record Patterns (Preview)](https://openjdk.org/jeps/405) as preview language features. - -In order to analyze a project with PMD that uses these language features, -you'll need to enable it via the environment variable `PMD_JAVA_OPTS` and select the new language -version `19-preview`: - - export PMD_JAVA_OPTS=--enable-preview - ./run.sh pmd -language java -version 19-preview ... - -Note: Support for Java 17 preview language features have been removed. The version "17-preview" is no longer available. - -#### Gherkin support -Thanks to the contribution from [Anne Brouwers](https://github.com/ASBrouwers) PMD now has CPD support -for the [Gherkin](https://cucumber.io/docs/gherkin/) language. It is used to defined test cases for the -[Cucumber](https://cucumber.io/) testing tool for behavior-driven development. - -Being based on a proper Antlr grammar, CPD can: - -* ignore comments -* honor [comment-based suppressions](pmd_userdocs_cpd.html#suppression) - ### Fixed Issues -* apex - * [#4056](https://github.com/pmd/pmd/pull/4056): \[apex] ApexSOQLInjection: Add support count query -* core - * [#3796](https://github.com/pmd/pmd/issues/3796): \[core] CPD should also provide a `--debug` flag - * [#4021](https://github.com/pmd/pmd/pull/4021): \[core] CPD: Add total number of tokens to XML reports - * [#4031](https://github.com/pmd/pmd/issues/4031): \[core] If report is written to stdout, stdout should not be closed - * [#4051](https://github.com/pmd/pmd/issues/4051): \[doc] Additional rulesets are not listed in documentation - * [#4053](https://github.com/pmd/pmd/pull/4053): \[core] Allow building PMD under Java 18+ -* java - * [#4015](https://github.com/pmd/pmd/issues/4015): \[java] Support JDK 19 -* java-bestpractices - * [#3455](https://github.com/pmd/pmd/issues/3455): \[java] WhileLoopWithLiteralBoolean - false negative with complex expressions -* java-design - * [#3729](https://github.com/pmd/pmd/issues/3729): \[java] TooManyMethods ignores "real" methods which are named like getters or setters - * [#3949](https://github.com/pmd/pmd/issues/3949): \[java] FinalFieldCouldBeStatic - false negative with unnecessary parenthesis -* java-performance - * [#3625](https://github.com/pmd/pmd/issues/3625): \[java] AddEmptyString - false negative with empty var -* lua - * [#4061](https://github.com/pmd/pmd/pull/4061): \[lua] Fix several related Lua parsing issues found when using CPD -* test - * [#3302](https://github.com/pmd/pmd/pull/3302): \[test] Improve xml test schema - * [#3758](https://github.com/pmd/pmd/issues/3758): \[test] Move pmd-test to java 8 - * [#3976](https://github.com/pmd/pmd/pull/3976): \[test] Extract xml schema module ### API Changes -#### CPD CLI - -* CPD has a new CLI option `--debug`. This option has the same behavior as in PMD. It enables more verbose - logging output. - -#### Rule Test Framework - -* The module "pmd-test", which contains support classes to write rule tests, now **requires Java 8**. If you depend on - this module for testing your own custom rules, you'll need to make sure to use at least Java 8. -* The new module "pmd-test-schema" contains now the XSD schema and the code to parse the rule test XML files. The - schema has been extracted in order to easily share it with other tools like the Rule Designer or IDE plugins. -* Test schema changes: - * The attribute `isRegressionTest` of `test-code` is deprecated. The new - attribute `disabled` should be used instead for defining whether a rule test should be skipped or not. - * The attributes `reinitializeRule` and `useAuxClasspath` of `test-code` are deprecated and assumed true. - They will not be replaced. - * The new attribute `focused` of `test-code` allows disabling all tests except the focused one temporarily. -* More information about the rule test framework can be found in the documentation: - [Testing your rules](pmd_userdocs_extending_testing.html) - -#### Deprecated API - -* The experimental Java AST class {% jdoc java::lang.java.ast.ASTGuardedPattern %} has been deprecated and - will be removed. It was introduced for Java 17 and Java 18 Preview as part of pattern matching for switch, - but it is no longer supported with Java 19 Preview. -* The interface {% jdoc core::cpd.renderer.CPDRenderer %} is deprecated. For custom CPD renderers - the new interface {% jdoc core::cpd.renderer.CPDReportRenderer %} should be used. -* The class {% jdoc test::testframework.TestDescriptor %} is deprecated, replaced with {% jdoc test-schema::test.schema.RuleTestDescriptor %}. -* Many methods of {% jdoc test::testframework.RuleTst %} have been deprecated as internal API. - -#### Experimental APIs - -* To support the Java preview language features "Pattern Matching for Switch" and "Record Patterns", the following - AST nodes have been introduced as experimental: - * {% jdoc java::lang.java.ast.ASTSwitchGuard %} - * {% jdoc java::lang.java.ast.ASTRecordPattern %} - * {% jdoc java::lang.java.ast.ASTComponentPatternList %} - -#### Internal API - -Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0. -You can identify them with the `@InternalApi` annotation. You'll also get a deprecation warning. - -* {%jdoc !!core::cpd.CPDConfiguration#setRenderer(net.sourceforge.pmd.cpd.Renderer) %} -* {%jdoc !!core::cpd.CPDConfiguration#setCPDRenderer(net.sourceforge.pmd.cpd.renderer.CPDRenderer) %} -* {%jdoc !!core::cpd.CPDConfiguration#getRenderer() %} -* {%jdoc !!core::cpd.CPDConfiguration#getCPDRenderer() %} -* {%jdoc !!core::cpd.CPDConfiguration#getRendererFromString(java.lang.String,java.lang.String) %} -* {%jdoc !!core::cpd.CPDConfiguration#getCPDRendererFromString(java.lang.String,java.lang.String) %} -* {%jdoc core::cpd.renderer.CPDRendererAdapter %} - -### Financial Contributions - -Many thanks to our sponsors: - -* [Matt Hargett](https://github.com/matthargett) (@matthargett) - ### External Contributions -* [#3984](https://github.com/pmd/pmd/pull/3984): \[java] Fix AddEmptyString false-negative issue - [@LiGaOg](https://github.com/LiGaOg) -* [#3988](https://github.com/pmd/pmd/pull/3988): \[java] Modify WhileLoopWithLiteralBoolean to meet the missing case #3455 - [@VoidxHoshi](https://github.com/VoidxHoshi) -* [#3992](https://github.com/pmd/pmd/pull/3992): \[java] FinalFieldCouldBeStatic - fix false negative with unnecessary parenthesis - [@dalizi007](https://github.com/dalizi007) -* [#3994](https://github.com/pmd/pmd/pull/3994): \[java] TooManyMethods - improve getter/setter detection (#3729) - [@341816041](https://github.com/341816041) -* [#4017](https://github.com/pmd/pmd/pull/4017): Add Gherkin support to CPD - [@ASBrouwers](https://github.com/ASBrouwers) -* [#4021](https://github.com/pmd/pmd/pull/4021): \[core] CPD: Add total number of tokens to XML reports - [@maikelsteneker](https://github.com/maikelsteneker) -* [#4056](https://github.com/pmd/pmd/pull/4056): \[apex] ApexSOQLInjection: Add support count query - [@gwilymatgearset](https://github.com/gwilymatgearset) -* [#4061](https://github.com/pmd/pmd/pull/4061): \[lua] Fix several related Lua parsing issues found when using CPD - [@matthargett](https://github.com/matthargett) - -### Stats -* 102 commits -* 26 closed tickets & PRs -* Days since last release: 35 {% endtocmaker %} diff --git a/docs/pages/release_notes_old.md b/docs/pages/release_notes_old.md index e5b53bc05d..cd56c15d74 100644 --- a/docs/pages/release_notes_old.md +++ b/docs/pages/release_notes_old.md @@ -5,6 +5,155 @@ permalink: pmd_release_notes_old.html Previous versions of PMD can be downloaded here: https://github.com/pmd/pmd/releases +## 30-July-2022 - 6.48.0 + +The PMD team is pleased to announce PMD 6.48.0. + +This is a minor release. + +### Table Of Contents + +* [New and noteworthy](#new-and-noteworthy) + * [Java 19 Support](#java-19-support) + * [Gherkin support](#gherkin-support) +* [Fixed Issues](#fixed-issues) +* [API Changes](#api-changes) + * [CPD CLI](#cpd-cli) + * [Rule Test Framework](#rule-test-framework) + * [Deprecated API](#deprecated-api) + * [Experimental APIs](#experimental-apis) + * [Internal API](#internal-api) +* [Financial Contributions](#financial-contributions) +* [External Contributions](#external-contributions) +* [Stats](#stats) + +### New and noteworthy + +#### Java 19 Support + +This release of PMD brings support for Java 19. There are no new standard language features. + +PMD supports [JEP 427: Pattern Matching for switch (Third Preview)](https://openjdk.org/jeps/427) and +[JEP 405: Record Patterns (Preview)](https://openjdk.org/jeps/405) as preview language features. + +In order to analyze a project with PMD that uses these language features, +you'll need to enable it via the environment variable `PMD_JAVA_OPTS` and select the new language +version `19-preview`: + + export PMD_JAVA_OPTS=--enable-preview + ./run.sh pmd -language java -version 19-preview ... + +Note: Support for Java 17 preview language features have been removed. The version "17-preview" is no longer available. + +#### Gherkin support +Thanks to the contribution from [Anne Brouwers](https://github.com/ASBrouwers) PMD now has CPD support +for the [Gherkin](https://cucumber.io/docs/gherkin/) language. It is used to defined test cases for the +[Cucumber](https://cucumber.io/) testing tool for behavior-driven development. + +Being based on a proper Antlr grammar, CPD can: + +* ignore comments +* honor [comment-based suppressions](pmd_userdocs_cpd.html#suppression) + +### Fixed Issues +* apex + * [#4056](https://github.com/pmd/pmd/pull/4056): \[apex] ApexSOQLInjection: Add support count query +* core + * [#3796](https://github.com/pmd/pmd/issues/3796): \[core] CPD should also provide a `--debug` flag + * [#4021](https://github.com/pmd/pmd/pull/4021): \[core] CPD: Add total number of tokens to XML reports + * [#4031](https://github.com/pmd/pmd/issues/4031): \[core] If report is written to stdout, stdout should not be closed + * [#4051](https://github.com/pmd/pmd/issues/4051): \[doc] Additional rulesets are not listed in documentation + * [#4053](https://github.com/pmd/pmd/pull/4053): \[core] Allow building PMD under Java 18+ +* java + * [#4015](https://github.com/pmd/pmd/issues/4015): \[java] Support JDK 19 +* java-bestpractices + * [#3455](https://github.com/pmd/pmd/issues/3455): \[java] WhileLoopWithLiteralBoolean - false negative with complex expressions +* java-design + * [#3729](https://github.com/pmd/pmd/issues/3729): \[java] TooManyMethods ignores "real" methods which are named like getters or setters + * [#3949](https://github.com/pmd/pmd/issues/3949): \[java] FinalFieldCouldBeStatic - false negative with unnecessary parenthesis +* java-performance + * [#3625](https://github.com/pmd/pmd/issues/3625): \[java] AddEmptyString - false negative with empty var +* lua + * [#4061](https://github.com/pmd/pmd/pull/4061): \[lua] Fix several related Lua parsing issues found when using CPD +* test + * [#3302](https://github.com/pmd/pmd/pull/3302): \[test] Improve xml test schema + * [#3758](https://github.com/pmd/pmd/issues/3758): \[test] Move pmd-test to java 8 + * [#3976](https://github.com/pmd/pmd/pull/3976): \[test] Extract xml schema module + +### API Changes + +#### CPD CLI + +* CPD has a new CLI option `--debug`. This option has the same behavior as in PMD. It enables more verbose + logging output. + +#### Rule Test Framework + +* The module "pmd-test", which contains support classes to write rule tests, now **requires Java 8**. If you depend on + this module for testing your own custom rules, you'll need to make sure to use at least Java 8. +* The new module "pmd-test-schema" contains now the XSD schema and the code to parse the rule test XML files. The + schema has been extracted in order to easily share it with other tools like the Rule Designer or IDE plugins. +* Test schema changes: + * The attribute `isRegressionTest` of `test-code` is deprecated. The new + attribute `disabled` should be used instead for defining whether a rule test should be skipped or not. + * The attributes `reinitializeRule` and `useAuxClasspath` of `test-code` are deprecated and assumed true. + They will not be replaced. + * The new attribute `focused` of `test-code` allows disabling all tests except the focused one temporarily. +* More information about the rule test framework can be found in the documentation: + [Testing your rules](pmd_userdocs_extending_testing.html) + +#### Deprecated API + +* The experimental Java AST class ASTGuardedPattern has been deprecated and + will be removed. It was introduced for Java 17 and Java 18 Preview as part of pattern matching for switch, + but it is no longer supported with Java 19 Preview. +* The interface CPDRenderer is deprecated. For custom CPD renderers + the new interface CPDReportRenderer should be used. +* The class TestDescriptor is deprecated, replaced with RuleTestDescriptor. +* Many methods of RuleTst have been deprecated as internal API. + +#### Experimental APIs + +* To support the Java preview language features "Pattern Matching for Switch" and "Record Patterns", the following + AST nodes have been introduced as experimental: + * ASTSwitchGuard + * ASTRecordPattern + * ASTComponentPatternList + +#### Internal API + +Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0. +You can identify them with the `@InternalApi` annotation. You'll also get a deprecation warning. + +* CPDConfiguration#setRenderer +* CPDConfiguration#setCPDRenderer +* CPDConfiguration#getRenderer +* CPDConfiguration#getCPDRenderer +* CPDConfiguration#getRendererFromString +* CPDConfiguration#getCPDRendererFromString +* CPDRendererAdapter + +### Financial Contributions + +Many thanks to our sponsors: + +* [Matt Hargett](https://github.com/matthargett) (@matthargett) + +### External Contributions +* [#3984](https://github.com/pmd/pmd/pull/3984): \[java] Fix AddEmptyString false-negative issue - [@LiGaOg](https://github.com/LiGaOg) +* [#3988](https://github.com/pmd/pmd/pull/3988): \[java] Modify WhileLoopWithLiteralBoolean to meet the missing case #3455 - [@VoidxHoshi](https://github.com/VoidxHoshi) +* [#3992](https://github.com/pmd/pmd/pull/3992): \[java] FinalFieldCouldBeStatic - fix false negative with unnecessary parenthesis - [@dalizi007](https://github.com/dalizi007) +* [#3994](https://github.com/pmd/pmd/pull/3994): \[java] TooManyMethods - improve getter/setter detection (#3729) - [@341816041](https://github.com/341816041) +* [#4017](https://github.com/pmd/pmd/pull/4017): Add Gherkin support to CPD - [@ASBrouwers](https://github.com/ASBrouwers) +* [#4021](https://github.com/pmd/pmd/pull/4021): \[core] CPD: Add total number of tokens to XML reports - [@maikelsteneker](https://github.com/maikelsteneker) +* [#4056](https://github.com/pmd/pmd/pull/4056): \[apex] ApexSOQLInjection: Add support count query - [@gwilymatgearset](https://github.com/gwilymatgearset) +* [#4061](https://github.com/pmd/pmd/pull/4061): \[lua] Fix several related Lua parsing issues found when using CPD - [@matthargett](https://github.com/matthargett) + +### Stats +* 102 commits +* 26 closed tickets & PRs +* Days since last release: 35 + ## 25-June-2022 - 6.47.0 The PMD team is pleased to announce PMD 6.47.0. From 533428db9b1cecbfed998890f5407234590d0500 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 30 Jul 2022 12:23:19 +0200 Subject: [PATCH 11/13] Bump pmd from 6.47.0 to 6.48.0 --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index aef9c8a492..1f7aa9e9b7 100644 --- a/pom.xml +++ b/pom.xml @@ -407,22 +407,22 @@ net.sourceforge.pmd pmd-core - 6.47.0 + 6.48.0 net.sourceforge.pmd pmd-java - 6.47.0 + 6.48.0 net.sourceforge.pmd pmd-jsp - 6.47.0 + 6.48.0 net.sourceforge.pmd pmd-javascript - 6.47.0 + 6.48.0 From 8a41e13bdbaa163727f6402484727b63717d94c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 10 Aug 2022 00:18:21 +0200 Subject: [PATCH 12/13] test-schema: fix wrong warning message --- .../net/sourceforge/pmd/test/schema/BaseTestParserImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/BaseTestParserImpl.java b/pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/BaseTestParserImpl.java index 192b11ba4a..761fa508bf 100644 --- a/pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/BaseTestParserImpl.java +++ b/pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/BaseTestParserImpl.java @@ -96,7 +96,7 @@ class BaseTestParserImpl { parseBoolAttribute(testCode, "useAuxClasspath", true, err, "Attribute 'useAuxClasspath' is deprecated and ignored, assumed true"); boolean disabled = parseBoolAttribute(testCode, "disabled", false, err, null) - | !parseBoolAttribute(testCode, "regressionTest", true, err, "Attribute ''regressionTest'' is deprecated, use ''ignored'' with inverted value"); + | !parseBoolAttribute(testCode, "regressionTest", true, err, "Attribute ''regressionTest'' is deprecated, use ''disabled'' with inverted value"); descriptor.setDisabled(disabled); From 2977bd8764ef01152e9f74b2786ee43b937b5379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 10 Aug 2022 17:26:20 +0200 Subject: [PATCH 13/13] test-schema: fix tests --- .../net/sourceforge/pmd/test/schema/TestSchemaParserTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1b38d243f6..286b61cd8e 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 @@ -82,7 +82,7 @@ public class TestSchemaParserTest { assertEquals(1, parsed.getTests().size()); MatcherAssert.assertThat(errStreamCaptor.getLog(), containsString(" 6| \n" - + " ^^^^^^^^^^^^^^ Attribute 'regressionTest' is deprecated, use 'ignored' with inverted value\n")); + + " ^^^^^^^^^^^^^^ Attribute 'regressionTest' is deprecated, use 'disabled' with inverted value\n")); } @Test