Compare commits

..

249 Commits

Author SHA1 Message Date
Andreas Dangel 495294d09e set at least the pom version to 4.3.1-SNAPSHOT in the branch
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7438 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-10 19:54:38 +00:00
Andreas Dangel 0d3cba2a2e correct svn url for branch 4.3
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7436 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-10 19:33:54 +00:00
Romain Pelisse 2b7463ac4d Fix boggy link on website
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7435 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 20:31:38 +00:00
Romain Pelisse 0ac6f23098 Add note regarding PMD's JDK new default settings (Java7)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7434 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:55:09 +00:00
Romain Pelisse c6cc722fc1 Fix date typo on website main page.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7432 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:20:18 +00:00
Romain Pelisse af3d0be27e documenting an ugly hack for maven 1
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7431 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:20:02 +00:00
Romain Pelisse d7ac591da0 updating changelog
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7430 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:19:44 +00:00
Romain Pelisse 32fb4784d6 Add links to release to main page
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7429 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:19:22 +00:00
Romain Pelisse a585e1d1bb whitespaces
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7428 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:19:02 +00:00
Romain Pelisse 83a811f2f8 Test Ant integration with PMD sources rather than the one from the JDK
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7427 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:18:40 +00:00
Romain Pelisse f58ecd51dc remove rsync release to sf, as it has become useless
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7426 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:18:18 +00:00
Romain Pelisse 307040f53f update release script to use 4.3.x instead of 4.2.x
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7425 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:17:58 +00:00
Romain Pelisse 4cb3e53d4b add 43.xml to regroup new rules for 4.3 release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7424 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:17:40 +00:00
Romain Pelisse 314151c761 bump version to 4.3
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7423 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-06 15:17:16 +00:00
Andreas Dangel cca1aac4d9 using shell.sourceforge.net as repo server for uploading artifacts
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7422 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-05 16:25:57 +00:00
Dinesh Bolkensteyn 2654bbff4d 4.3.x Improved the PreserveStackTrace rule to support Java 7
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7413 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-01 14:24:17 +00:00
Dinesh Bolkensteyn 8bbca10f73 PMD 4.3.x Java 7 is now default and better 1.5 targetJdk handling
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7412 51baf565-9d33-0410-a72c-fc3788e3496d
2011-11-01 13:56:31 +00:00
Romain Pelisse 3dea951e0c fix small typo on website (missing link content)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7406 51baf565-9d33-0410-a72c-fc3788e3496d
2011-10-14 14:13:09 +00:00
Romain Pelisse 3cd12def47 Applied patch 4320938: CPD GUI Launcher script only supports Microsoft Windows, thanks to Tom Wheeler
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7405 51baf565-9d33-0410-a72c-fc3788e3496d
2011-10-14 14:12:49 +00:00
Romain Pelisse ad3086eb2b whitespaces
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7403 51baf565-9d33-0410-a72c-fc3788e3496d
2011-10-14 13:48:07 +00:00
Romain Pelisse f2ac93a42d Applied patch 2822131: Enhance SuspiciousEqualsMethodName, thanks to Andy Throgmorton
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7402 51baf565-9d33-0410-a72c-fc3788e3496d
2011-10-14 13:47:45 +00:00
Romain Pelisse 14cc641316 Applied patch 2822173: Fix false negative for UseArraysAsList when the array was passed as method parameter. Thanks to Andy Throgmorton.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7400 51baf565-9d33-0410-a72c-fc3788e3496d
2011-10-13 15:54:39 +00:00
Romain Pelisse b60d442777 Generated source modifications (by javacc - due to change to support Java 7)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7397 51baf565-9d33-0410-a72c-fc3788e3496d
2011-10-13 15:41:39 +00:00
Romain Pelisse a050468aea Applied patch 3411811: Java 7 support for PMD, thanks to Dinesh Bolkensteyn and SonarSource.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7396 51baf565-9d33-0410-a72c-fc3788e3496d
2011-10-13 15:40:35 +00:00
Andreas Dangel 85914a9a2c renamed eclipse project to 4.3.x, using ANT_HOME/lib/ant.jar in build classpath
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7384 51baf565-9d33-0410-a72c-fc3788e3496d
2011-10-03 17:46:58 +00:00
Andreas Dangel 232eeb24f0 correct the default maven deploy repository
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7371 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-30 18:29:21 +00:00
Andreas Dangel 8cebc5dc84 Added license info to pom.xml, extended next release howto for maven
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7366 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-29 18:57:21 +00:00
Romain Pelisse 0496cc8fc5 Fix patch 3130615: fix xpath rule to consider the correct if-condition.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7362 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-29 14:52:46 +00:00
Romain Pelisse 66ef2399e3 Applied patch 3013807: DoNotCallSystemExit through Runtime. Thanks to Steven Christou.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7361 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-29 14:28:37 +00:00
Romain Pelisse ee246222ae add missing test file for new rule GuardDebugLogging
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7360 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-29 14:26:27 +00:00
Romain Pelisse 791ddbef0b Applied patch 3130615: New Rule GuardDebugLogging for jakarta-commons logging. Thanks to Tammo van Lessen.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7359 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-29 13:59:25 +00:00
Romain Pelisse d0f2ec451a Applied patch 3155140: Exclude boolean getters (is*) from
TooManyMethods rule. Thanks to Riku Nykanen.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7353 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-25 20:05:52 +00:00
Romain Pelisse 9487afa38f add last patch to changelog
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7352 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-25 20:05:07 +00:00
Romain Pelisse ba1404de3f applied patch 2828099 : Designer's bug 'Create XML Rule', thanks to Andy Throgmorton
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7339 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-24 19:33:07 +00:00
Romain Pelisse c8da4a1c83 whitelines + reindent
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7338 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-24 19:32:41 +00:00
Romain Pelisse 5155cdd50d add missing link to typeresolution rulesets
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7329 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-24 00:54:13 +00:00
Romain Pelisse d0af1fc350 applied patch 2996539 : Add support for C# to CPD (simple parser)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7327 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-24 00:29:17 +00:00
Romain Pelisse 94b5c9f797 sync credits webpage with trunk
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7325 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-23 23:57:40 +00:00
Romain Pelisse fb32b871d8 adding Andy Throgmorton to the contributor list
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7324 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-23 23:57:23 +00:00
Romain Pelisse 1668a79f03 applied patch 2829888 : New rule: Calling Thread.run() - thanks to Andy Throgmorton
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7323 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-23 23:57:05 +00:00
Romain Pelisse 340e0f2583 apply patch 3084292: character reference in xml report - thanks to Seko
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7318 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-23 17:34:11 +00:00
Romain Pelisse 4155d94028 apply patch 3175832 from Cd-MaN: Add options to to the CPD command line task.
While applying the patch, I discover that properties where never really
used and not passed down to the language implementation. In order to fix
that and keep the loose coupling we currently have, I used the system
properties.
Also did isolate that in a separate function and did a (little) code
cleaning.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7317 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-23 17:33:41 +00:00
Romain Pelisse d79bc38bd1 merge changes to release script from 4.3.x
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7301 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-21 17:57:34 +00:00
Romain Pelisse 3efe93295c update 4.3.x branch with lastest modification from 4.2.x
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.3.x@7292 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-19 17:42:21 +00:00
Romain Pelisse ad7c32bcff add new rules to rulesets/releases/42.xml
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7258 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:47:19 +00:00
Romain Pelisse 6112861894 removing a bunch of old/unused files from etc folder...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7257 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:19:04 +00:00
Romain Pelisse ec289775c3 making script logging messages a tad more consistent
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7256 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:18:45 +00:00
Romain Pelisse d10160ae45 rename generate_release script to simply release.sh
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7255 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:18:29 +00:00
Romain Pelisse bbd2b945cf enhance release script to support the a snapshot option, rendering the extra generate_snapshot script useless
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7254 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:18:11 +00:00
Romain Pelisse 866eb78393 make source release script more consistent with the binary release part
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7253 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:17:53 +00:00
Romain Pelisse ba6485bdc7 use different folder for the bin and the src release to avoid confusion during the script execution
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7252 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:17:36 +00:00
Romain Pelisse a40c07aeb2 remove unused script's variables
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7251 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:17:18 +00:00
Romain Pelisse a37296d7b9 add a function to create root directory tree to harmonize script action between src release and binary release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7250 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:17:03 +00:00
Romain Pelisse 260e0730b7 fix inconsistency in variable uses
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7249 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:16:46 +00:00
Romain Pelisse 384cfa8bcd using mktemp() to have a temporary folder for each build make pointless the preventing rm -rf on the previous potential files...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7248 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:16:30 +00:00
Romain Pelisse 3f39a04a58 move current_dir check in an earlier step of the script
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7247 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:16:14 +00:00
Romain Pelisse a3393f4b13 remove dependency to asm in project.xml
As it seems that ASM is no longer available in Maven 1 repository, this dependency leads to
a build failure. As Maven 1 is ONLY used to generate the xdocs documenation, and has been removed
from the trunk, it does not seems relevant to try to fix this. Removing the depedency does allow
one to build the documentation, which what we need here...

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7246 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:15:58 +00:00
Romain Pelisse 17442f2028 fix typos in xdocs (& to &)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7245 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:15:42 +00:00
Romain Pelisse c7933c9700 make docs.sh able to use svn or git to restore files
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7244 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:15:26 +00:00
Romain Pelisse 779e304d18 removes all copy of folder related to the pmd 1.4 compliant release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7243 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:15:12 +00:00
Romain Pelisse 61498acc39 extract version number from pom.xml - makes -v optional, check if release script is executed from the 'etc' folder
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7242 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:14:54 +00:00
Romain Pelisse 12faf9023b enhance release script to use getopt and support args - instead of interactive commands
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7241 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:14:35 +00:00
Romain Pelisse 46671ba8b8 set release script to stop on the first shell failure
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7240 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:14:17 +00:00
Romain Pelisse d1c1863f07 remove retroweaver for build - it seems broken right now and having a Java 1.4 compliant version of PMD is somewhat less critical today...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7239 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:14:01 +00:00
Romain Pelisse 75201a5a60 ensure that release script fails when ant build fails
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7238 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:13:45 +00:00
Romain Pelisse 0b23f48cf4 fix trailing whitespaces in changelog
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7237 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:13:29 +00:00
Romain Pelisse 73a989fc97 enhance release script to check for required dependencies (ant, maven, mvn...)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7236 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:13:10 +00:00
Romain Pelisse 779526036a add usage function for release script, and missing required argument check
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7235 51baf565-9d33-0410-a72c-fc3788e3496d
2011-09-11 19:12:54 +00:00
Romain Pelisse 19da0dfc1a Applied patch from Juan Jesús García de Soria on CPD
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7106 51baf565-9d33-0410-a72c-fc3788e3496d
2010-07-24 14:12:52 +00:00
Ryan Gustafson ffc48e9835 Performance optimization for ends-with type include/exclude patterns. Assuming one has N patterns, and M files to check, one starts to see noticeable improvements once N*M is greater than 100,000.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7071 51baf565-9d33-0410-a72c-fc3788e3496d
2010-02-13 05:34:10 +00:00
Ryan Gustafson fdb5dcc628 Add reference to QAPlug for Intellaj IDEA.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7068 51baf565-9d33-0410-a72c-fc3788e3496d
2010-02-02 15:59:13 +00:00
Ryan Gustafson 043e5d02f3 Add reference to SolidSDD, similar to CPD.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7067 51baf565-9d33-0410-a72c-fc3788e3496d
2010-01-26 00:53:11 +00:00
Romain Pelisse 7a083a30e9 applied patch from Nicolas Dordet to fix False+ on CloseResource - ID: 2920057.
Thanks Nicolas !

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7049 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-28 15:00:35 +00:00
Dale Anson c831d82bf0 Added vararg to constructor so it matches with super constructor.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7027 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-12 16:21:03 +00:00
Dale Anson 2130c12ba3 Updated changelog to note Ecmascript is now supported by CPD.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7025 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-09 17:11:39 +00:00
Dale Anson 79ef486724 Changed javascript to ecmascript.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7024 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-09 17:10:47 +00:00
Dale Anson b937b65558 Changed javascript to ecmascript.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7023 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-09 17:09:14 +00:00
Dale Anson 38044fb7f5 Added javascript as a supported language for CPD.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7019 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-09 02:22:56 +00:00
Ryan Gustafson cc3f172ef2 Fix url for new rule.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7016 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-05 22:36:32 +00:00
Ryan Gustafson 8fe5a0d780 Add support for Unicode for JSP/JSF.
Add support to not parse body of <script> for JSP/JSF.
Add new NoInlineScript rule for JSP/JSF.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7015 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-05 22:34:45 +00:00
Romain Pelisse f67056e7d7 fixing performance issue on PreserveStackTrace by removing use of descendant:: axis. See bug 1808110
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7010 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-04 14:37:46 +00:00
Romain Pelisse 59eaa27c59 Adding a new rule : GenericsNaming
Thanks to Nicolas Dordet for his inputs on this one.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7009 51baf565-9d33-0410-a72c-fc3788e3496d
2009-12-04 13:37:26 +00:00
Ryan Gustafson d836721675 Fix for 2904832. ClassTypeResolver was clobbering the importedClasses in populateImports set by populateClassName. Changed to clobber at ASTCompilationUnit, then everyone adds to the map.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7005 51baf565-9d33-0410-a72c-fc3788e3496d
2009-11-27 18:13:13 +00:00
Romain Pelisse aaeaefad1a oups, forgot to add new rule to changelog.txt
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7001 51baf565-9d33-0410-a72c-fc3788e3496d
2009-11-14 15:57:33 +00:00
Romain Pelisse 6f857aa813 oups forgot to add UseConcurrentHashMap to test class
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6998 51baf565-9d33-0410-a72c-fc3788e3496d
2009-11-14 15:01:15 +00:00
Romain Pelisse 1d7d5e6474 Adding a new rule 'UseConcurrentHashMap' to promote use of ConcurrentHashMap implementation in Java 5
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6997 51baf565-9d33-0410-a72c-fc3788e3496d
2009-11-14 15:00:48 +00:00
Romain Pelisse a73b7f1fb1 Fix bug 2832322 - cpd.xml file tag path attribute should be entity-encoded.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6988 51baf565-9d33-0410-a72c-fc3788e3496d
2009-08-16 13:18:39 +00:00
Romain Pelisse 64d3bc28cb Oups, this stateless crap of mine from my previous commit was erronous.
Rule are NOT recreated for each new source file, we need to clean the state of this object... Therefore I add this piece of code back.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6986 51baf565-9d33-0410-a72c-fc3788e3496d
2009-08-16 01:25:30 +00:00
Romain Pelisse 8b4ade3016 While debugging I realise that PMD rules are 'stateless', so I remove my code to clean the ArrayList at each passage.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6985 51baf565-9d33-0410-a72c-fc3788e3496d
2009-08-15 18:05:52 +00:00
Romain Pelisse 60c0bcb858 finally fixing bug 'wz-pmd-report.xslt in release 4.2.5 misses file name - ID: 2609540'
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6980 51baf565-9d33-0410-a72c-fc3788e3496d
2009-08-15 17:20:10 +00:00
Romain Pelisse 0b60a2d6ff making field private and adding missing @Override
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6979 51baf565-9d33-0410-a72c-fc3788e3496d
2009-08-15 17:19:47 +00:00
Romain Pelisse 73ebf2603a Fixing bug 2826119 - False +: DoubleCheckedLocking warning with volatile field
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6978 51baf565-9d33-0410-a72c-fc3788e3496d
2009-08-15 16:40:53 +00:00
Romain Pelisse 6f427f9fa5 Fixing bug : False -: DoubleCheckedLocking with reversed null check - ID: 2835074
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6976 51baf565-9d33-0410-a72c-fc3788e3496d
2009-08-15 15:58:49 +00:00
Ryan Gustafson d6b326838f Added AvoidLosingExceptionInformation from George Thomas.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6972 51baf565-9d33-0410-a72c-fc3788e3496d
2009-07-21 01:43:49 +00:00
Romain Pelisse 0e3a92c291 Adding link to my own article, in French, on PMD
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6968 51baf565-9d33-0410-a72c-fc3788e3496d
2009-06-30 12:33:10 +00:00
Romain Pelisse bbc1d2a02f Fixing bug 2810228 : updating cpd documentation.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6965 51baf565-9d33-0410-a72c-fc3788e3496d
2009-06-22 14:25:55 +00:00
Xavier Le Vourch 0e1bf46e07 new Android rule DoNotHardCodeSDCard taken from my blog article on how to use PMD in Android projects
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6960 51baf565-9d33-0410-a72c-fc3788e3496d
2009-06-13 20:34:03 +00:00
Xavier Le Vourch 6243e25400 asm jars updated to 3.2
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6954 51baf565-9d33-0410-a72c-fc3788e3496d
2009-06-13 00:13:38 +00:00
Ryan Gustafson ae499b9132 Fixed bug 2724653 - AvoidThreadGroup reports false positives
Changed Rule to use Type Resolution.


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6918 51baf565-9d33-0410-a72c-fc3788e3496d
2009-04-24 02:51:55 +00:00
Ryan Gustafson c168ecc6e5 Correct -benchmark reporting of Rule visits via the RuleChain
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6912 51baf565-9d33-0410-a72c-fc3788e3496d
2009-04-18 08:21:27 +00:00
Xavier Le Vourch ac439685fc Android ruleset: CallSuperLast rule now also checks for finish() redefinitions
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6891 51baf565-9d33-0410-a72c-fc3788e3496d
2009-03-22 23:06:42 +00:00
Xavier Le Vourch 2321376151 new rule AvoidLiteralsInIfCondition added to controversial ruleset
Patch contributed by Nadhamuni Kothapalle

https://sourceforge.net/tracker/?func=detail&atid=479923&aid=2591627&group_id=56262


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6888 51baf565-9d33-0410-a72c-fc3788e3496d
2009-03-22 22:50:57 +00:00
Ryan Gustafson f7cefa4a7d Fixed bug 2645268 - ClassCastException in UselessOperationOnImmutable.getDeclaration
Problem was due to incorrect assumption about AST structure, when Annotations are present on a local declaration.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6879 51baf565-9d33-0410-a72c-fc3788e3496d
2009-03-01 09:57:16 +00:00
Xavier Le Vourch eeb8b10892 Fixed bug 2606609 - False "UnusedImports" positive in package-info.java
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6874 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-23 17:45:51 +00:00
Romain Pelisse 2577acd87e Cleanup: Moving testcase for bug '1843273 : False - on SimplifyBooleanReturns' to the appropriate file.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6858 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-19 23:40:14 +00:00
Romain Pelisse e3ad18317a Adding fix for bug [2317099] False + in SimplifyConditional to changelog
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6856 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-19 22:24:12 +00:00
Romain Pelisse 6bc10af45e Test case and fix for bug [2317099 ] false + in SimplifyConditional.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6855 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-19 22:23:19 +00:00
Romain Pelisse 5a1a457eae Reproducing bug False 2606609: 'UnusedImports' positive in package-info.java
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6849 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-16 23:54:51 +00:00
Romain Pelisse 59a60be0d2 Adding Bug fix 2590258 - NPE with nicerhtml output to changelog.txt
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6848 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-16 12:17:34 +00:00
Romain Pelisse f7aa88db54 Bug Fix: NPE in XsltRenderer
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6847 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-16 12:17:11 +00:00
Xavier Le Vourch eb371c24a1 wrong since attribute
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6843 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-12 19:30:51 +00:00
Xavier Le Vourch a846ccb014 New rule in strictexceptions : AvoidCatchingGenericException
patch submitted by Nadhamuni Kothapalle

https://sourceforge.net/tracker/?func=detail&atid=479923&aid=2591604&group_id=56262


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6842 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-12 19:28:38 +00:00
Xavier Le Vourch a31f7f3578 next dev cycle: 4.2.6-SNAPSHOT
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6838 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-09 02:37:38 +00:00
Xavier Le Vourch ecb51fbac5 upload of maven files to sourceforge was not correctly done
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6837 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-09 02:29:08 +00:00
Xavier Le Vourch 3ab42655dc web site updates for 4.2.5 changes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6836 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-09 01:54:53 +00:00
Xavier Le Vourch c44b0c2c87 android ruleset was not in changelog
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6832 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-09 01:18:15 +00:00
Xavier Le Vourch 2817991f7d preparing 4.2.5 release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6830 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-09 00:52:32 +00:00
Xavier Le Vourch ce0fd33919 local.properties ignored
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6829 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-09 00:46:29 +00:00
Xavier Le Vourch 316ef30f5b note for Fixed bug 2027626 - False + : AvoidFinalLocalVariable
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6828 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-09 00:43:32 +00:00
Romain Pelisse 7a7381829a Final fix
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6824 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-08 21:57:20 +00:00
Romain Pelisse 9e0de88bc2 Adding testcase to reproduce bug 2027626 : 'False + : AvoidFinalLocalVariable'
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6823 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-08 21:56:58 +00:00
Xavier Le Vourch 13f6224635 2009 added to copyright
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6821 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-08 21:30:56 +00:00
Xavier Le Vourch a4e7012c63 dogfood location must be on branch or the pmd plugin complain about internal/pmdspecific.xml from the trunk
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6820 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-08 21:29:41 +00:00
Xavier Le Vourch de924b50cf Fixed bug 2142986 - UselessOverridingMethod doesn't consider annotations
new property 'ignoreAnnotations' to get the old behavior


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6818 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-08 19:19:33 +00:00
Romain Pelisse 605de6f7bf Bug fixing 1609038 - Xslt report generators break if path contains 'java'.
As suggested by bug reporter i switch call to 'translate' and call to 'substring-before'.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6816 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-05 10:57:28 +00:00
Xavier Le Vourch 751ed84e0d new rule in strictexception: AvoidThrowingNewInstanceOfSameException
contributed by George Thomas:

https://sourceforge.net/tracker/?func=detail&atid=479923&aid=2566369&group_id=56262


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6814 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-05 03:29:15 +00:00
Xavier Le Vourch b5a90924a7 CallSuperFirst android rule now accepts logging before call to super()
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6812 51baf565-9d33-0410-a72c-fc3788e3496d
2009-02-04 23:50:51 +00:00
Romain Pelisse ca664ea719 Adding test case for bug '[2115761] False +: System.arraycopy is more efficient'
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6811 51baf565-9d33-0410-a72c-fc3788e3496d
2009-01-31 21:39:39 +00:00
Romain Pelisse d740f68a94 Test case to reproduce [1732744] False + : basic/UselessOperationOnImmutable
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6810 51baf565-9d33-0410-a72c-fc3788e3496d
2009-01-29 13:48:18 +00:00
Romain Pelisse d20f8f2291 Test case to reproduce [1622281 ] Loop scoping dodgy
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6809 51baf565-9d33-0410-a72c-fc3788e3496d
2009-01-29 13:21:34 +00:00
Romain Pelisse 72cc961ca8 Fix for bug 2225474 - VariableNamingConventions does not work with nonprimitives
- Adding a test case to reproduce the issue ;
- Fix ;
- Changelog updated.
Special thanks to Markus Kling for pointing this fix to me.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6807 51baf565-9d33-0410-a72c-fc3788e3496d
2009-01-28 20:51:58 +00:00
Xavier Le Vourch e26de08062 new ruleset for Android platform
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6803 51baf565-9d33-0410-a72c-fc3788e3496d
2009-01-27 23:52:27 +00:00
Xavier Le Vourch 9b4b50560d Recent change in UseSingleton introduced a false + for methods with annotations
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6802 51baf565-9d33-0410-a72c-fc3788e3496d
2009-01-27 23:43:03 +00:00
Xavier Le Vourch 240e548c36 new script to build snapshot: etc/generate_snapshot.sh
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6800 51baf565-9d33-0410-a72c-fc3788e3496d
2009-01-27 20:24:02 +00:00
Xavier Le Vourch 9172c26905 code cleanup: grammar and spelling
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6797 51baf565-9d33-0410-a72c-fc3788e3496d
2009-01-24 18:48:10 +00:00
Romain Pelisse 1b2063cf94 Working on bug : https://sourceforge.net/tracker2/?func=detail&aid=2410201&group_id=56262&atid=479921
I reproduced the issue and trace the problem back to the symbol table (More exactly a method of the NameOccurences class). I also added a test to reproduced the issue here. (Also added a little javadoc).

I'm not really although how to "assert" results in this test, not really sure how the symbol table should be expected to behave here.

No more time right now for this, i'll try see through this week. 

Note: I'll patch trunk when I'll have fix for good this issue.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6759 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-21 15:36:56 +00:00
Xavier Le Vourch 8c64498325 Fixed bug - JUnitTestsShouldIncludeAssert now detects Junit 4 Assert.assert... constructs
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6753 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-13 00:12:54 +00:00
Xavier Le Vourch ffb1131fe0 deprecated JRE_LIB replaced with org.eclipse.jdt.launching.JRE_CONTAINER
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6752 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-11 18:50:48 +00:00
Xavier Le Vourch 3f719b9b0f oops, NPE in previous commit...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6751 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-11 07:25:27 +00:00
Xavier Le Vourch aea7c89175 oops, NPE in previous commit...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6749 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-11 07:09:45 +00:00
Xavier Le Vourch 0fb697a50b Fixed bug 2404700 - UseSingleton should not act on enums
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6746 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-11 06:32:25 +00:00
Xavier Le Vourch e300a2630b Fixed bug 1955852 - false positives for UnusedPrivateMethod & UnusedLocalVariable
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6744 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-11 00:48:43 +00:00
Romain Pelisse 59646f99d2 Resync the credits.xml with trunk.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6739 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-02 15:10:14 +00:00
Romain Pelisse 743d2da79a Adding credit entry on Sergey Pariev for his fix on Ruby CPD.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6738 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-02 15:08:36 +00:00
Romain Pelisse 4e8664c244 Oups, last commit included test case for bug [ 1955852 ] false positives for UnusedPrivateMethod & UnusedLocalField. Setting them to non regression test.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6737 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-02 12:09:32 +00:00
Romain Pelisse 5948b700b3 Oups, last commit included test case for bug [ 1955852 ] false positives for UnusedPrivateMethod & UnusedLocalField. Setting them to non regression test.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6736 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-02 12:09:01 +00:00
Romain Pelisse 2a8cf167b9 Remove useless addons in the Eclipse 's .classpath file.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6735 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-02 11:11:46 +00:00
Romain Pelisse d4aad400d5 Fix for bug [ 2315599 ] False +: UseSingleton with class containing constructor.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6733 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-02 09:02:44 +00:00
Romain Pelisse f7f2532566 Oups, this forget to update changelog when I applied provided patch for :
[ 2338341 ] ArrayIndexOutOfBoundsException in cpd on rails project.




git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6731 51baf565-9d33-0410-a72c-fc3788e3496d
2008-12-01 21:05:21 +00:00
Xavier Le Vourch 8cdc5bd985 code cleanup: better XPath expression for ClassWithOnlyPrivateConstructorsShouldBeFinal
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6704 51baf565-9d33-0410-a72c-fc3788e3496d
2008-11-27 17:36:03 +00:00
Xavier Le Vourch 0252a9c905 Fixed bug 2230809 - False +: ClassWithOnlyPrivateConstructorsShouldBeFinal
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6703 51baf565-9d33-0410-a72c-fc3788e3496d
2008-11-27 17:06:30 +00:00
Xavier Le Vourch 8f8afde50b Fixed bug 2315623 - @SuppressWarnings("PMD.UseSingleton") has no effect
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6701 51baf565-9d33-0410-a72c-fc3788e3496d
2008-11-24 21:00:23 +00:00
Romain Pelisse 6836ae8bcd Committing small patch for CPD (Ruby). See https://sourceforge.net/tracker/index.php?func=detail&aid=2338341&group_id=56262&atid=479921 for more details. This small fix does not break unit test, but more testing will be nice.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6698 51baf565-9d33-0410-a72c-fc3788e3496d
2008-11-24 19:04:55 +00:00
Ryan Gustafson 51ca03348c Better exception handling.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6637 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-18 21:19:11 +00:00
Ryan Gustafson 41d0550d99 Enhanced logging in the ClassTypeResolver to provide more detailed messaging.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6632 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-18 05:09:43 +00:00
Xavier Le Vourch 06bb1a6f27 Java grammar fix: TypeParameter name wasn't set
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6629 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-17 17:24:37 +00:00
Xavier Le Vourch fc173e08c8 preparing for next version 4.2.5-SNAPSHOT
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6598 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-13 18:20:59 +00:00
Xavier Le Vourch 14461efefd sourceforge access changes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6597 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-13 08:20:45 +00:00
Xavier Le Vourch 68c1d53a59 4.2.4 release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6596 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-13 04:00:45 +00:00
Xavier Le Vourch 80a7ece0bc preparing for 4.2.4 release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6594 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-13 03:36:18 +00:00
Xavier Le Vourch 10f5aa8d69 Fixed patch 2075906 - Add toString() to the rule UnnecessaryWrapperObjectCreation
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6591 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-11 18:38:37 +00:00
Xavier Le Vourch 9893f33977 link to snapshot web site in 'Future releases' section
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6583 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-07 23:20:34 +00:00
Ryan Gustafson 2e0bffe7a3 Correct changelog comment.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6575 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-07 02:03:56 +00:00
Ryan Gustafson 718ef77283 Set exclude marker on parser to fix NPE.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6574 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-07 01:57:12 +00:00
Xavier Le Vourch 4ac13741ab cpd ant task documentation for attributes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6555 51baf565-9d33-0410-a72c-fc3788e3496d
2008-10-03 23:43:05 +00:00
Xavier Le Vourch f3c1227dcc code cleanup: extra '[' in <![CDATA[ removed
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6515 51baf565-9d33-0410-a72c-fc3788e3496d
2008-09-26 19:05:10 +00:00
Xavier Le Vourch 7cd887ba8c merge from trunk: Fixed ClassCastException in symbol table code
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6468 51baf565-9d33-0410-a72c-fc3788e3496d
2008-09-10 19:54:21 +00:00
Xavier Le Vourch c07f274b4e merged from trunk: Fixed ClassCastException on generic method in BeanMembersShouldSerialize
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6466 51baf565-9d33-0410-a72c-fc3788e3496d
2008-09-10 18:34:41 +00:00
Xavier Le Vourch 037cf154f7 merge from trunk:
relative paths for custom rulesets are now handled properly when ant is called
from a different directory using the "-f" option.


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6448 51baf565-9d33-0410-a72c-fc3788e3496d
2008-09-04 22:54:47 +00:00
Xavier Le Vourch 69ff09410a Fixed bug 1943204 - Ant task: <ruleset> path should be relative to Ant basedir
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6442 51baf565-9d33-0410-a72c-fc3788e3496d
2008-09-03 23:38:32 +00:00
Xavier Le Vourch 39e59dd02f merged from trunk: Fixed bug 1481051 - false + UnusedNullCheckInEquals (and other false positives too)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6440 51baf565-9d33-0410-a72c-fc3788e3496d
2008-09-03 20:22:39 +00:00
Xavier Le Vourch 7ed88ed4cf merge from trunk: Dr. Wedemann isn't working in this area anymore, so removing this
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6435 51baf565-9d33-0410-a72c-fc3788e3496d
2008-09-02 16:24:17 +00:00
Xavier Le Vourch ef13f147ce javacc updated to official 4.1 version
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6434 51baf565-9d33-0410-a72c-fc3788e3496d
2008-09-02 16:18:24 +00:00
Xavier Le Vourch e0dbf498e2 version updated to 4.2.4-SNAPSHOT
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6430 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-31 21:32:19 +00:00
Xavier Le Vourch c777f4d548 old obsolete info removed
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6429 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-31 21:11:45 +00:00
Xavier Le Vourch b3d2a856a8 changes for 4.2.3 release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6428 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-31 20:30:45 +00:00
Xavier Le Vourch 59a61fb58c 4.2.3 description on web site
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6427 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-31 20:05:06 +00:00
Xavier Le Vourch 7e018ac3bd extra quote removed
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6426 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-31 19:51:21 +00:00
Xavier Le Vourch d4e6c1872d preparing 4.2.3 release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6424 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-31 19:26:42 +00:00
Xavier Le Vourch 767cea113d merge from trunk:
Fixed handling of escape characters in UseIndexOfChar and AppendCharacterWithChar


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6422 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-28 20:27:04 +00:00
Xavier Le Vourch 5f2d71cdde Fixed bug 1556594 - Wonky detection of NullAssignment
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6418 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-28 01:56:07 +00:00
Xavier Le Vourch 263b91d556 Fixed bug 2050064 - False + SuspiciousOctalEscape with backslash literal
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6415 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-28 01:04:34 +00:00
Xavier Le Vourch 94cfdb93fd Fixed bug 1977438 - False positive for UselessStringValueOf
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6414 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-28 00:16:23 +00:00
Xavier Le Vourch 91ad44ba0a Fixed false negative in UselessOverridingMethod
using < 0 instead of > 0 in getting argument list size. Maybe we should have a rule to detect this...


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6408 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-26 19:19:14 +00:00
Xavier Le Vourch 2141dba366 code cleanup: unused import
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6400 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-25 19:41:26 +00:00
Xavier Le Vourch d700a3ea11 All comment types are now stored in ASTCompilationUnit, not just formal ones
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6398 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-25 19:36:11 +00:00
Xavier Le Vourch 7a6f82b222 javacc.jar added to lib directory to get reproduceable builds
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6391 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-25 00:54:30 +00:00
Ryan Gustafson 1da7b889b7 Added credit for Jared's patch.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6386 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-24 06:09:43 +00:00
Ryan Gustafson 8b9942436d Java grammar enhanced to include AnnotationMethodDeclaration as parent node of method related children of AnnotationTypeMemberDeclaration.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6385 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-24 06:01:18 +00:00
Ryan Gustafson 3d0d4436de JavaCC generated artifacts updated to JavaCC 4.1d1.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6384 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-24 05:16:45 +00:00
Xavier Le Vourch 5620b24c8f Fixed bug 2056318 - False positive for AvoidInstantiatingObjectsInLoops
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6370 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-19 22:18:34 +00:00
Ryan Gustafson 8a0052dee9 Added YourKit Java Profiler logo to Credits.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6369 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-15 13:34:31 +00:00
Ryan Gustafson 80e5944dcd Add requested credit for YourKit, for use of licenses.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6341 51baf565-9d33-0410-a72c-fc3788e3496d
2008-08-08 13:00:36 +00:00
Xavier Le Vourch 169ab5d225 Fixed bug 2002722 - false + in UseStringBufferForStringAppends
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6334 51baf565-9d33-0410-a72c-fc3788e3496d
2008-07-22 17:54:45 +00:00
Xavier Le Vourch d1e9279f3a merging updates from the trunk
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6332 51baf565-9d33-0410-a72c-fc3788e3496d
2008-07-18 16:47:44 +00:00
Xavier Le Vourch 244c79ecb0 merge from trunk:
testTSM() disabled in regress mode:

because of random failures during continuous integration,
tests are disabled in regress mode until somebody figures out
what the tests are supposed to measure and why they sometime fail


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6312 51baf565-9d33-0410-a72c-fc3788e3496d
2008-07-01 20:45:01 +00:00
Xavier Le Vourch 10bc1bab17 Adding top level build.xml to have a more standard setup and ease continuous
integration configuration


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6311 51baf565-9d33-0410-a72c-fc3788e3496d
2008-07-01 20:37:21 +00:00
Xavier Le Vourch 1b59db43f3 merge from trunk: Looks like the Ant task doesn't take 'debug' anymore
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6310 51baf565-9d33-0410-a72c-fc3788e3496d
2008-07-01 16:39:45 +00:00
Romain Pelisse 18e444b448 Oups, i forgot to remove attribute language and to change xpath class back
to net.sourceforge.pmd.rules.XPathRule.
Corrected (thanks again to Ryan for this report).

By the way, it seems that the continous integration process is not set to
yell at us if we broke the build on the pmd-4.2.x branch. 
If this is not too much work, it surely be nice to have.



git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6267 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-24 16:27:26 +00:00
Romain Pelisse be028ccaef Adding a proper example to TooFewBranchesForASwitchStatement
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6266 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-24 12:03:34 +00:00
Xavier Le Vourch 4583fde181 fix false positives in UselessOperationOnImmutable
false positives included string were used in expressions and BigInteger
as method arguments. The immutable object is ignored only if expression's
parent is a statement expression.


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6237 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-20 19:58:54 +00:00
Xavier Le Vourch a0b8ff4c4a SuppressWarning fixes:
Fixed bug 1998185 - BeanMembersShouldSerialize vs @SuppressWarnings("serial")

@SuppressWarnings("all") disables all warnings


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6236 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-19 21:47:07 +00:00
Xavier Le Vourch 9ce5a5be43 Optimizations and false positive fixes in PreserveStackTrace
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6232 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-19 03:50:50 +00:00
Xavier Le Vourch d951795634 Fixed bug 1977230 - false positive: UselessOverridingMethod
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6205 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-14 00:37:10 +00:00
Romain Pelisse f663b9773a Applying patch [ 1958961 ] EmptyInitializer
Not really bug fix, but the patch was easy to apply so, why deprive soon to be 4.2.X user from this little addon... 

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6201 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-13 22:07:56 +00:00
Romain Pelisse 79a84939c5 Applying patch [ 1966013 ] Missing cases in UselessOperationOnImmutable
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6197 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-13 20:36:32 +00:00
Ryan Gustafson b287a5a73c Fixed bug 1989814 - false +: ConsecutiveLiteralAppends
If the definitive type of an AdditiveExpression is known to be other than a String, don't complain.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6186 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-10 20:58:24 +00:00
Ryan Gustafson d9c6cb8b31 Fixed bug 1988829 - Violation reported without source file name (actually a fix to ConsecutiveLiteralAppends)
Allowed rootNode to be defaulted whenever 'concurrentCount' is more than 0.  This will allow a VariableDeclaration to be identified as the rootNode, even if it is never referenced later.  JUnit tests pass, I hope this doesn't have unintended consequences.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6184 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-10 05:56:05 +00:00
Ryan Gustafson 791e3f10e4 Additional fixing to get exclude-pattern to work with multiple RuleSets.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6178 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-04 05:04:43 +00:00
Ryan Gustafson 8534a438a6 Update RuleChainVisitor to group rules by RuleSet, and use RuleSet.applies(File) before visiting.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6170 51baf565-9d33-0410-a72c-fc3788e3496d
2008-06-03 17:22:48 +00:00
Xavier Le Vourch 185958c419 Fixes for exclude-pattern
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6169 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-30 22:00:19 +00:00
Ryan Gustafson 123fc5f64f Update RuleSet writing documentation to mention <exclude-pattern>/<include-pattern>.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6161 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-28 19:28:21 +00:00
Xavier Le Vourch eed1a59034 cenqua link fixed and logo added
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6159 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-27 21:52:20 +00:00
Xavier Le Vourch 2ab3bd3ac6 cleanup of pmd-test-<version>.jar build
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6150 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-23 23:07:47 +00:00
Romain Pelisse bf5c221439 Adding back the excludes lines. The classes were excludes
as they are part of the pmd.jar.


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6145 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-23 09:09:28 +00:00
Romain Pelisse f84db1bffc Adding the generation of pmd-test.jar to the target 'jar'.
It's a quick fix.

Also note that i removed the following line from the jar 
creation:
excludes="test/net/sourceforge/pmd/testframework/**/**" 
this lead to exclude the testframework itself, which lead
to a pretty useless jar.

I didn't remove the pmd-test jar creation from the 
retroweaver task neither remove this exclusion. Retro
Weaver part of the build is still not working on my 
laptop, so i didn't want to alter without the capability
to test my modifications.

I modify the 4.2.3 first because of this. This way, if we have to
release a 4.2.3 before 5.0, the pmd-test.jar should be
in it.


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6139 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-22 15:46:43 +00:00
Xavier Le Vourch 0043392460 version updated to 4.2.3-SNAPSHOT
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6137 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-20 19:56:32 +00:00
Xavier Le Vourch 99a31e423a updates for uploading 4.2.2
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6136 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-20 19:47:11 +00:00
Xavier Le Vourch 823d3447c8 preparing for 4.2.2 release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6134 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-20 18:27:25 +00:00
Ryan Gustafson 68ff19de08 Reverse chronological order for releases, and change 'pmd' to 'PMD'.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6133 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-20 17:13:06 +00:00
Xavier Le Vourch 55218c6196 front page updated to include recent releases and short roadmap
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6130 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-20 17:05:02 +00:00
Xavier Le Vourch ab934c2a9b link to article by Alan Berg
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6129 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-20 17:04:01 +00:00
Xavier Le Vourch cd2745d5fe maven 1 pmd plugin page links to maven 2 plugin
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6128 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-20 17:02:35 +00:00
Xavier Le Vourch f9590d218a UnnecessaryParentheses now checks all expressions, not just return statements
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6126 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-19 03:15:40 +00:00
Xavier Le Vourch cfde99a990 Documentation of AvoidDuplicateLiterals properties
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6117 51baf565-9d33-0410-a72c-fc3788e3496d
2008-05-16 00:39:26 +00:00
Xavier Le Vourch d2429a95cc copy/paste error in MoreThanOneLogger
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6075 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-28 18:46:14 +00:00
Xavier Le Vourch 713dc2a9a5 Bug fix: NPE in MoreThanOneLogger
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6073 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-28 18:34:24 +00:00
Xavier Le Vourch 411cf2826f Fixed parsing bug: constant fields in annotation classes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6071 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-27 23:47:59 +00:00
Xavier Le Vourch 99348a8582 Fixed false positive in UnusedImports: javadoc comments are parsed to check @see and other tags
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6023 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-16 23:34:30 +00:00
Xavier Le Vourch 33bcfed90f version changed to 4.2.2-SNAPSHOT in Java and 4.2.2 in other files
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6020 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-16 21:52:03 +00:00
Xavier Le Vourch cdb5525716 Fixed false positive in UnusedImports: javadoc comments are parsed to check @see and other tags
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6018 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-16 21:18:35 +00:00
Xavier Le Vourch d157b08bee 4.2.1 links updated
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6011 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-11 22:05:10 +00:00
Xavier Le Vourch dc353cb718 preparing 4.2.1 release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6007 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-11 21:25:11 +00:00
Romain Pelisse adfd316184 Fixed bug 1808110 - PreserveStackTrace
(backport from trunk)

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6006 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-11 17:47:30 +00:00
Xavier Le Vourch 2f4cdbd6c3 backport of: AvoidDuplicateLiteralRule now has 'skipAnnotations' boolean property
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6004 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-11 16:41:42 +00:00
Xavier Le Vourch bbad2dfbc2 preparing 4.2.1 release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6001 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-09 19:34:58 +00:00
Xavier Le Vourch ce49bdd986 Added file encoding option to CPD GUI, which already existed for the command line and Ant
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6000 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-09 16:00:10 +00:00
Ryan Gustafson d61aa6189f Remove unintentionally copied line.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5997 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-09 01:07:23 +00:00
Xavier Le Vourch 1593b8037d bin scripts: cygwin-run.sh removed, only cpd, designer and pmd scripts should be in binary release
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5996 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-09 00:05:21 +00:00
Xavier Le Vourch e659268f29 standard unix scripts can be used with cygwin
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5995 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-08 23:55:58 +00:00
Xavier Le Vourch e4fa5f88fe support for extra languages in cpd.sh
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5994 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-08 23:44:19 +00:00
Xavier Le Vourch 84cad6c1c4 retroweaver version was not correct in java14/bin scripts
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5993 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-08 23:34:59 +00:00
Ryan Gustafson 7a3d8ceb9a Update RuleSetWriter to handle non-Apache TRAX implementations, add an option to not use XML Namespaces
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5992 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-08 23:21:45 +00:00
Xavier Le Vourch 159cbfa9e9 ruleset.dtd and ruleset_xml_schema.xsd added to jar file in rulesets directory
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5990 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-08 21:58:07 +00:00
Xavier Le Vourch 89b1d699bf Fixed classpath issue in pmdOnPmd target
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5983 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-07 01:31:58 +00:00
Xavier Le Vourch 76a293d720 Fixed classpath issue in pmd target
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5981 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-07 01:17:05 +00:00
Romain Pelisse 4378fd6bdf Fixed bug 1932242 - EmptyMethodInAbstractClassShouldBeAbstract false +
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5952 51baf565-9d33-0410-a72c-fc3788e3496d
2008-04-02 16:47:36 +00:00
Ryan Gustafson 4d127404d3 Fix bug 1928009 - Error using migration ruleset in PMD 4.2
AbstractRuleChainVisitor changed an 'if' to a 'while' to ensure all RuleReferences were followed to find the real underlying Rule.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5942 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-28 22:45:43 +00:00
Xavier Le Vourch e84d41bebb '41' and '42' shortcuts for rulesets added
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5933 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-26 21:31:19 +00:00
7055 changed files with 239975 additions and 637673 deletions
-7901
View File
File diff suppressed because it is too large Load Diff
-248
View File
@@ -1,248 +0,0 @@
# PMD CI Scripts
This folder contains scripts used for CI, that are PMD specific.
Added line: 8803
Added line: 397
Added line: 2389
## .ci/files/public-env.gpg
Added line: 2050
This files contains the following environment variables:
Added line: 893
* DANGER_GITHUB_API_TOKEN: Token for danger to add comments to PRs as <https://github.com/pmd-test>.
Added line: 7092
Added line: 1776
Added line: 1458
Added line: 371
The token needs the scope "public_repo". Note: The default GITHUB_TOKEN can't be used, because
danger runs in pull request builds from fork and the default GITHUB_TOKEN has read-only access there
Added line: 2166
and can't write comments. Therefore the personal access token of the bot account "pmd-test" is used.
pmd-test has no commit permissions, but can comment on any public repo, including pmd/pmd.
Added line: 9706
* PMD_CI_CHUNK_TOKEN: Token for uploading reports to chunk.io
Added line: 2997
Added line: 7686
The file is encrypted, so that the tokens are not automatically disabled when github detects them
in clear text.
**Decrypting**:
Added line: 2218
Added line: 5258
gpg --batch --yes --decrypt --passphrase="GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
Added line: 6105
--output .ci/files/public-env .ci/files/public-env.gpg
Added line: 2860
**Encrypting**:
gpg --batch --symmetric --cipher-algo AES256 \
Added line: 7658
--armor --passphrase="GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
--output .ci/files/public-env.gpg .ci/files/public-env
## Local tests with docker
Added line: 2256
Added line: 7698
Using the same docker container as described in [build-env @ build-tools](https://github.com/pmd/build-tools).
Added line: 4848
Added line: 8614
### Testing a push build (snapshot)
Added line: 6717
Added line: 6493
Added line: 2139
Added line: 6240
Start docker without binding to local directory, so that we can do a fresh checkout
Added line: 9468
$ docker run \
Added line: 860
--interactive \
Added line: 7791
--tty \
Added line: 7787
--name pmd-build-env_pmd \
Added line: 1200
Added line: 966
Added line: 8897
Added line: 3773
pmd-build-env:latest
Added line: 7538
Added line: 1343
Added line: 2876
```
export LANG=en_US.UTF-8
export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/main/scripts
export PMD_CI_SECRET_PASSPHRASE="xyz"
export PMD_CI_DEBUG=true
MAIN_BRANCH="main"
Added line: 6291
eval $(~/create-gh-actions-env.sh push pmd/pmd $MAIN_BRANCH)
Added line: 7570
cd /workspaces/pmd
rmdir pmd && mkdir pmd
cd pmd
Added line: 4917
Added line: 3164
git init
git remote add origin https://github.com/pmd/pmd
Added line: 1903
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/${MAIN_BRANCH}:refs/remotes/origin/${MAIN_BRANCH}
git checkout --progress --force -B ${MAIN_BRANCH} refs/remotes/origin/${MAIN_BRANCH}
Added line: 5869
Added line: 5152
f=check-environment.sh; \
mkdir -p .ci && \
Added line: 2051
Added line: 1620
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
chmod 755 .ci/$f && \
.ci/$f
.ci/build.sh
Added line: 9212
Added line: 7311
Added line: 1160
```
Added line: 6015
### Testing a pull request
Added line: 9301
Same as the above, but this line changes:
```
eval $(~/create-gh-actions-env.sh pull_request pmd/pmd $MAIN_BRANCH)
Added line: 6346
```
Added line: 8915
Added line: 4922
Maybe update `/workspaces/event.json` to fill in a real pull request number, so that
Added line: 7442
danger can comment the correct PR.
Added line: 5479
And the checkout must be different. Example for PR 3220:
Added line: 7539
Added line: 7078
```
Added line: 4982
PMD_CI_PULL_REQUEST_NUMBER=3220
cd /workspace/pmd
rmdir pmd && mkdir pmd
cd pmd
Added line: 7346
git init
git remote add origin https://github.com/pmd/pmd
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/pull/${PMD_CI_PULL_REQUEST_NUMBER}/merge:refs/remotes/pull/${PMD_CI_PULL_REQUEST_NUMBER}/merge
git checkout --progress --force refs/remotes/pull/${PMD_CI_PULL_REQUEST_NUMBER}/merge
Added line: 6442
Added line: 5540
Added line: 9041
Added line: 4588
```
### Forked build
Added line: 5245
Added line: 5591
A build executing on a forked repository.
Added line: 5218
Added line: 2624
```
Added line: 7960
Added line: 6452
Added line: 997
$(~/create-gh-actions-env.sh push adangel/pmd $MAIN_BRANCH)
Added line: 695
```
### Performing a release (push) build
```
export LANG=en_US.UTF-8
export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/main/scripts
export PMD_CI_SECRET_PASSPHRASE="xyz"
Added line: 9624
export PMD_CI_DEBUG=true
Added line: 9218
TAG_NAME=pmd_releases/6.33.0
Added line: 9734
eval $(~/create-gh-actions-env.sh push pmd/pmd refs/tags/$TAG_NAME)
Added line: 455
Added line: 3217
Added line: 157
Added line: 7411
rmdir pmd && mkdir pmd
cd pmd
Added line: 2538
Added line: 6507
git init
Added line: 6832
Added line: 7703
git remote add origin https://github.com/pmd/pmd
Added line: 3659
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/tags/$TAG_NAME:refs/tags/$TAG_NAME
git checkout --progress --force refs/tags/$TAG_NAME
Added line: 4641
Added line: 2311
f=check-environment.sh; \
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
Added line: 3275
Added line: 5836
chmod 755 .ci/$f && \
.ci/$f
Added line: 3796
Added line: 59
Added line: 7823
Added line: 1286
Added line: 720
Added line: 9688
Added line: 6803
#
# .ci/build.sh
Added line: 9008
Added line: 2611
#
```
Calling `.ci/build.sh` directly would re-release the tag $TAG_NAME - that's why it is commented out.
All the side-effects of a release would be carried out like creating and publishing a release on github,
Added line: 3239
Added line: 9164
Added line: 3855
uploading the release to sourceforge, uploading the docs to docs.pmd-code.org, uploading a
new baseline for the regression tester and so on. While the release should be reproducible and therefore should
Added line: 8770
Note that maven-central would not be changed, since this is skipped via MAVEN_OPTS:
`MAVEN_OPTS` contains `-DskipRemoteStaging=true`, so that no maven artifacts are deployed
to maven central (this is set by `create-gh-actions-env.sh`).
So for now in order to test the build script, you need to manually edit the script and comment out the
critical lines... (like publish github releases, uploading files to sourceforge ...). Later a
"dry-run" mode could be added.
Make sure to cleanup after the test, e.g. discard the draft github release.
## Workflow git-repo-sync
-371
View File
File diff suppressed because it is too large Load Diff
-27
View File
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="All Regression Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>Every apex and java rule in PMD which is used for the regression tests with pmdtester</description>
<rule ref="category/apex/bestpractices.xml" />
<rule ref="category/apex/codestyle.xml" />
<rule ref="category/apex/design.xml" />
<rule ref="category/apex/documentation.xml" />
<rule ref="category/apex/errorprone.xml" />
<rule ref="category/apex/multithreading.xml" />
<rule ref="category/apex/performance.xml" />
<rule ref="category/apex/security.xml" />
<rule ref="category/java/bestpractices.xml" />
<rule ref="category/java/codestyle.xml" />
<rule ref="category/java/design.xml" />
<rule ref="category/java/documentation.xml" />
<rule ref="category/java/errorprone.xml" />
<rule ref="category/java/multithreading.xml" />
<rule ref="category/java/performance.xml" />
<rule ref="category/java/security.xml" />
</ruleset>
-199
View File
@@ -1,199 +0,0 @@
<?xml version="1.0"?>
<projectlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="projectlist_1_1_0.xsd">
<description>Standard Projects</description>
<project>
<name>checkstyle</name>
<type>git</type>
<connection>https://github.com/checkstyle/checkstyle</connection>
<tag>checkstyle-9.1</tag>
<exclude-pattern>.*/target/test-classes/com/puppycrawl/tools/checkstyle/.*</exclude-pattern>
<exclude-pattern>.*/target/generated-sources/.*</exclude-pattern>
<exclude-pattern>.*/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/javaparser/InputJavaParserNoFreezeOnDeeplyNestedLambdas.java</exclude-pattern>
<build-command><![CDATA[#!/usr/bin/env bash
if test -e classpath.txt; then
exit
fi
set -e
# Make sure to use java11. This is already installed by build.sh
export JAVA_HOME=${HOME}/openjdk11
export PATH=$JAVA_HOME/bin:$PATH
mvn test-compile -B
mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.txt -B
]]></build-command>
<auxclasspath-command>echo -n "$(pwd)/target/classes:$(pwd)/target/test-classes:"; cat classpath.txt</auxclasspath-command>
</project>
<project>
<name>spring-framework</name>
<type>git</type>
<connection>https://github.com/spring-projects/spring-framework</connection>
<tag>v5.3.13</tag>
<exclude-pattern>.*/build/generated-sources/.*</exclude-pattern>
<build-command><![CDATA[#!/usr/bin/env bash
## Skip gradle execution
if test -e classpath.txt; then
exit
fi
set -e
# Make sure to use java11. This is already installed by build.sh
export JAVA_HOME=${HOME}/openjdk11
export PATH=$JAVA_HOME/bin:$PATH
## Patches
# keep the tabs!!
# Patch 1: See https://github.com/spring-projects/spring-framework/commit/381b7d035a16d430b8783b7390c1677c9e7d1f68
# and https://github.com/spring-projects/spring-framework/commit/9e1ed6c7718d38c4b9fe5f75921abad33264307c
(cat <<EOF
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
index 37f5884e67..53022443ee 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
@@ -539,7 +539,9 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
*/
@SuppressWarnings({"deprecation", "cast"})
protected boolean determineRequiredStatus(MergedAnnotation<?> ann) {
- return determineRequiredStatus(
+ // Cast to (AnnotationAttributes) is required. Otherwise, the :spring-beans:compileGroovy
+ // task fails in the Gradle build.
+ return determineRequiredStatus((AnnotationAttributes)
ann.asMap(mergedAnnotation -> new AnnotationAttributes(mergedAnnotation.getType())));
}
EOF
) | patch --strip=1
# Patch 2: Ignore compiler warnings
(cat <<EOF
diff --git a/buildSrc/src/main/java/org/springframework/build/compile/CompilerConventionsPlugin.java b/buildSrc/src/main/java/org/springframework/build/compile/CompilerConventionsPlugin.java
index f2424c549e..b6ec8b04da 100644
--- a/buildSrc/src/main/java/org/springframework/build/compile/CompilerConventionsPlugin.java
+++ b/buildSrc/src/main/java/org/springframework/build/compile/CompilerConventionsPlugin.java
@@ -51,7 +51,7 @@ public class CompilerConventionsPlugin implements Plugin<Project> {
COMPILER_ARGS.addAll(commonCompilerArgs);
COMPILER_ARGS.addAll(Arrays.asList(
"-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
- "-Xlint:unchecked", "-Werror"
+ "-Xlint:unchecked"//, "-Werror"
));
TEST_COMPILER_ARGS = new ArrayList<>();
TEST_COMPILER_ARGS.addAll(commonCompilerArgs);
diff --git a/spring-beans/spring-beans.gradle b/spring-beans/spring-beans.gradle
index e3f6f73b76..48c4d9e3fb 100644
--- a/spring-beans/spring-beans.gradle
+++ b/spring-beans/spring-beans.gradle
@@ -23,7 +23,7 @@ sourceSets {
}
compileGroovy {
- options.compilerArgs += "-Werror"
+// options.compilerArgs += "-Werror"
}
// This module also builds Kotlin code and the compileKotlin task naturally depends on
EOF
) | patch --strip=1
# Patch 3: Add task createSquishClasspath
(cat <<EOF
diff --git a/build.gradle b/build.gradle
index 6021fa574d..15d29ed699 100644
--- a/build.gradle
+++ b/build.gradle
@@ -431,3 +431,19 @@ configure(rootProject) {
}
}
}
+
+// see https://stackoverflow.com/questions/28986968/generate-classpath-from-all-multiproject-gradle-build-dependencies
+task createSquishClasspath {
+ doLast {
+ def dependencies = new LinkedHashSet()
+ dependencies.addAll(moduleProjects.configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.file.flatten())
+ dependencies.addAll(moduleProjects.configurations.testCompileClasspath.resolvedConfiguration.resolvedArtifacts.file.flatten())
+
+ def paths = new ArrayList()
+ paths.addAll(moduleProjects.jar.outputs.files.asPath)
+ paths.addAll(moduleProjects.sourceSets.test.output.resourcesDir)
+ paths.addAll(moduleProjects.sourceSets.test.output.classesDirs.files.flatten())
+ paths.addAll(dependencies)
+ println paths.join(File.pathSeparator)
+ }
+}
EOF
) | patch --strip=1
# Patch 4: Add https://maven.repository.redhat.com/ga/ as repository in order to resolve
# dependency com.ibm.websphere/uow/6.0.2.17
# See https://spring.io/blog/2020/10/29/notice-of-permissions-changes-to-repo-spring-io-fall-and-winter-2020
(cat <<EOF
diff --git a/build.gradle b/build.gradle
index 6021fa57..8319ff76 100644
--- a/build.gradle
+++ b/build.gradle
@@ -291,6 +291,7 @@ configure(allprojects) { project ->
}
repositories {
mavenCentral()
+ maven { url "https://maven.repository.redhat.com/ga/" }
maven { url "https://repo.spring.io/libs-spring-framework-build" }
}
}
EOF
) | patch --strip=1
./gradlew --console=plain --build-cache --no-daemon --max-workers=4 build testClasses -x test -x javadoc -x api -x asciidoctor -x asciidoctorPdf
./gradlew --console=plain --build-cache --no-daemon --max-workers=4 createSquishClasspath -q > classpath.txt
]]></build-command>
<auxclasspath-command>cat classpath.txt</auxclasspath-command>
</project>
<project>
<name>openjdk-11</name>
<type>git</type>
<connection>https://github.com/openjdk/jdk</connection>
<tag>jdk-11+28</tag>
<src-subpath>src/java.base</src-subpath>
</project>
<project>
<name>Schedul-o-matic-9000</name>
<type>git</type>
<connection>https://github.com/SalesforceLabs/Schedul-o-matic-9000</connection>
<tag>6b1229ba43b38931fbbab5924bc9b9611d19a786</tag>
</project>
<project>
<name>fflib-apex-common</name>
<type>git</type>
<connection>https://github.com/apex-enterprise-patterns/fflib-apex-common</connection>
<tag>7e0891efb86d23de62811af56d87d0959082a322</tag>
</project>
<project>
<name>apex-link</name>
<type>git</type>
<connection>https://github.com/nawforce/apex-link</connection>
<tag>v2.3.0</tag>
<src-subpath>samples</src-subpath>
</project>
<project>
<name>java-regression-tests</name>
<type>git</type>
<connection>https://github.com/pmd/java-regression-tests</connection>
<tag>main</tag>
<auxclasspath-command>realpath java-regression-tests-*.jar</auxclasspath-command>
</project>
</projectlist>
-14
View File
@@ -1,14 +0,0 @@
-----BEGIN PGP MESSAGE-----
jA0ECQMC6NJFOgCtLK790sDsAV7zf22dX5W7Ki3LdPBesQvoN+fU5xjNcu9ytrOQ
pNDQybzmGkBU7gJM5sasTEv2OKp7h+nt8xSfaE8u0i4G0+yLGZKxbCrZoHnoBiaW
udpjvvxyKdEV8wn1DPsh/W9ARmxdJezpreUwmwExamYiVEXsWOr2DWST+DPVX+4I
5vAxi/YqO1/Pn+s/wIOKM/57otuVxwzwyUFxItJF4GV3NeCKt1cDQHRT1OSn2Mlw
1LY8oUJgjKVCzI9F7xSlHYRYtvUK2icc7lvwrUliXIlcVetUB6Swe5AJmtmQ63y0
EU52Uh7VPYjj929QgpoVpJHGTJl/Omyk63nb1EOrDWEVUMzg4fDsbAsmzvPyD/FR
R6S9OeJUCsLMXlu7MRHCQi0vDk3li25pVqJmFm9Ahk8tkY/yzgQLoWmVEOhl8xDY
oEQh0XNy9TxvzRzYlutYdU7K4ACohNsJN/MpKkRVzA3aMIBrNjVGa0dF8kd+7grg
fJ+MW8skcpIHDegDcxVAs+O4r9VO3UDAcx3E/kgdLAKSOV0sRt4ZbJZaML7sKkSV
muTtIhHzGwB41qKichY=
=fgy5
-----END PGP MESSAGE-----
-81
View File
@@ -1,81 +0,0 @@
#!/usr/bin/env bash
# Exit this script immediately if a command/function exits with a non-zero status.
set -e
SCRIPT_INCLUDES="log.bash utils.bash setup-secrets.bash"
# shellcheck source=inc/fetch_ci_scripts.bash
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
function git_repo_sync() {
echo
pmd_ci_utils_determine_build_env pmd/pmd
echo
if pmd_ci_utils_is_fork_or_pull_request; then
pmd_ci_log_error "This should not run on forked repositories or pull requests"
exit 0
fi
# only builds on pmd/pmd continue here
pmd_ci_log_group_start "Setup environment"
pmd_ci_setup_secrets_private_env
pmd_ci_setup_secrets_gpg_key
pmd_ci_setup_secrets_ssh
pmd_ci_log_group_end
pmd_ci_log_group_start "Git Sync"
git remote add pmd-sf "${PMD_SF_USER}@git.code.sf.net:/p/pmd/code"
if [ -n "${PMD_CI_BRANCH}" ]; then
retry 5 git push pmd-sf "${PMD_CI_BRANCH}:${PMD_CI_BRANCH}"
pmd_ci_log_success "Successfully pushed ${PMD_CI_BRANCH} to sourceforge"
elif [ -n "${PMD_CI_TAG}" ]; then
git push pmd-sf tag "${PMD_CI_TAG}"
pmd_ci_log_success "Successfully pushed tag ${PMD_CI_TAG} to sourceforge"
else
pmd_ci_log_error "Don't know what to do: neither PMD_CI_BRANCH nor PMD_CI_TAG is set"
exit 1
fi
pmd_ci_log_group_end
}
#
# From: https://gist.github.com/sj26/88e1c6584397bb7c13bd11108a579746
#
# Retry a command up to a specific number of times until it exits successfully,
# with exponential back off.
#
# $ retry 5 echo Hello
# Hello
#
# $ retry 5 false
# Retry 1/5 exited 1, retrying in 1 seconds...
# Retry 2/5 exited 1, retrying in 2 seconds...
# Retry 3/5 exited 1, retrying in 4 seconds...
# Retry 4/5 exited 1, retrying in 8 seconds...
# Retry 5/5 exited 1, no more retries left.
#
function retry {
local retries=$1
shift
local count=0
until "$@"; do
exit=$?
wait=$((2 ** $count))
count=$(($count + 1))
if [ $count -lt $retries ]; then
echo "Retry $count/$retries exited $exit, retrying in $wait seconds..."
sleep $wait
else
echo "Retry $count/$retries exited $exit, no more retries left."
return $exit
fi
done
return 0
}
git_repo_sync
exit 0
-19
View File
@@ -1,19 +0,0 @@
#!/usr/bin/env bash
function fetch_ci_scripts() {
local inc_dir
local inc_url
inc_dir="$(dirname "$0")/inc"
inc_url="${PMD_CI_SCRIPTS_URL:-https://raw.githubusercontent.com/pmd/build-tools/main/scripts}/inc"
mkdir -p "${inc_dir}"
for f in ${SCRIPT_INCLUDES}; do
if [ ! -e "${inc_dir}/$f" ]; then
curl -sSL "${inc_url}/$f" > "${inc_dir}/$f"
fi
[ "$PMD_CI_DEBUG" = "true" ] && echo "loading ${inc_dir}/$f in ${MODULE:-$0}"
# shellcheck source=/dev/null
source "${inc_dir}/$f" || exit 1
done
}
-93
View File
@@ -1,93 +0,0 @@
#!/usr/bin/env bash
MODULE="pmd-code-api"
SCRIPT_INCLUDES="log.bash"
# shellcheck source=inc/fetch_ci_scripts.bash
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
PMD_CODE_SSH_USER=pmd
PMD_CODE_DOCS_PATH=/docs.pmd-code.org/
function pmd_code_uploadDocumentation() {
local -r pmdVersion="$1"
local -r filename="$2"
local -r basefilename="$(basename "$filename")"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion filename=$filename"
scp "${filename}" ${PMD_CODE_SSH_USER}@pmd-code.org:${PMD_CODE_DOCS_PATH}
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
( test -h pmd-doc-${pmdVersion} && rm pmd-doc-${pmdVersion} || true ) && \
unzip -qo \"${basefilename}\" && \
rm \"${basefilename}\""
pmd_ci_log_info "Docs updated: https://docs.pmd-code.org/pmd-doc-${pmdVersion}/"
}
function pmd_code_removeDocumentation() {
local pmdVersion="$1"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion"
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
rm -rf \"pmd-doc-${pmdVersion}/\""
pmd_ci_log_info "Removed docs: https://docs.pmd-code.org/pmd-doc-${pmdVersion}/"
}
function pmd_code_createSymlink() {
local -r pmdVersion="$1"
local -r name="$2"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion name=$name"
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
rm -f \"$name\" && \
ln -s \"pmd-doc-${pmdVersion}\" \"$name\""
pmd_ci_log_info "Symlink created: https://docs.pmd-code.org/$name/ -> https://docs.pmd-code.org/pmd-doc-${pmdVersion}/"
}
function pmd_code_uploadJavadoc() {
local -r pmdVersion="$1"
local -r basePath="$2"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion basePath=$basePath"
for i in "${basePath}"/*/target/*-javadoc.jar */*/target/*-javadoc.jar; do
pmd_code_uploadJavadocModule "$pmdVersion" "$i"
done
# make sure https://docs.pmd-code.org/apidocs/ shows directory index
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}/apidocs\" && \
echo 'Options +Indexes' > .htaccess"
pmd_ci_log_info "Directory index enabled for https://docs.pmd-code.org/apidocs/"
}
function pmd_code_uploadJavadocModule() {
local -r pmdVersion="$1"
local -r moduleJavadocJar="$2"
local -r moduleJavadocJarBasename="$(basename "$moduleJavadocJar")"
local -r module=${moduleJavadocJarBasename%%-${pmdVersion}-javadoc.jar}
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion moduleJavadocJar=$moduleJavadocJar module=$module"
scp "$moduleJavadocJar" ${PMD_CODE_SSH_USER}@pmd-code.org:${PMD_CODE_DOCS_PATH}
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
mkdir -p \"apidocs/${module}/${pmdVersion}\" && \
unzip -qo -d \"apidocs/${module}/${pmdVersion}\" \"${moduleJavadocJarBasename}\" && \
rm \"${moduleJavadocJarBasename}\""
pmd_ci_log_info "JavaDoc for $module uploaded: https://docs.pmd-code.org/apidocs/${module}/${pmdVersion}/"
}
function pmd_code_removeJavadoc() {
local -r pmdVersion="$1"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion"
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
rm -rf apidocs/*/\"${pmdVersion}\""
pmd_ci_log_info "Removed Javadoc: https://docs.pmd-code.org/apidocs/*/${pmdVersion}/ is gone"
}
-71
View File
@@ -1,71 +0,0 @@
#!/usr/bin/env bash
MODULE="pmd-doc"
SCRIPT_INCLUDES="log.bash"
# shellcheck source=inc/fetch_ci_scripts.bash
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
# Used env vars:
# PMD_CI_JOB_URL
# PMD_CI_PUSH_COMMIT_COMPARE
#
# Executes jekyll and generates the documentation
# The documentation will be generated in the directory "docs/_site".
#
function pmd_doc_generate_jekyll_site() {
pushd docs || { echo "Directory 'docs' doesn't exist"; exit 1; }
echo -e "\n\n"
pmd_ci_log_info "Building documentation using jekyll..."
bundle config set --local path vendor/bundle
bundle install
bundle exec jekyll build
popd || exit 1
}
#
# Creates the pmd-doc.zip archive. It will be placed in "docs/".
#
function pmd_doc_create_archive() {
pushd docs || { echo "Directory 'docs' doesn't exist"; exit 1; }
echo -e "\n\n"
pmd_ci_log_info "Creating pmd-doc archive..."
mv _site "pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}"
zip -qr "pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip" "pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/"
pmd_ci_log_success "Successfully created pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
popd || exit 1
}
#
# Updates github pages branch "gh-pages" of the main repository,
# so that https://pmd.github.io/pmd/ has the latest (snapshot) content
#
function pmd_doc_publish_to_github_pages() {
echo -e "\n\n"
pmd_ci_log_info "Pushing the new site to github pages..."
git clone --branch gh-pages --depth 1 --origin origin https://github.com/pmd/pmd.git pmd-gh-pages
# clear the files first
rm -rf pmd-gh-pages/*
# copy the new site
cp -a "docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}"/* pmd-gh-pages/
(
cd pmd-gh-pages || { echo "Directory 'pmd-gh-pages' doesn't exist"; exit 1; }
git config user.name "PMD CI (pmd-bot)"
git config user.email "pmd-bot@users.noreply.github.com"
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n "x-access-token:${GITHUB_TOKEN}"|base64)"
git add -A
MSG="Update documentation
${PMD_CI_JOB_URL}
${PMD_CI_PUSH_COMMIT_COMPARE}"
git commit -q -m "$MSG"
git push origin HEAD:gh-pages
git config --local --unset-all http.https://github.com/.extraheader
pmd_ci_log_success "Successfully pushed site to https://pmd.github.io/pmd/"
)
}
-91
View File
@@ -1,91 +0,0 @@
#!/usr/bin/env bash
MODULE="pmd-doc"
SCRIPT_INCLUDES="log.bash openjdk.bash"
# shellcheck source=inc/fetch_ci_scripts.bash
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
#
# The functions here require the following environment variables:
# PMD_CI_BRANCH
#
# GITHUB_TOKEN
# PMD_CI_CHUNK_TOKEN
function regression_tester_setup_ci() {
gpg --batch --yes --decrypt --passphrase="GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
--output .ci/files/public-env .ci/files/public-env.gpg
# shellcheck disable=SC1091
source .ci/files/public-env >/dev/null 2>&1
rm .ci/files/public-env
if hash "bundle" 2>/dev/null; then
pmd_ci_log_debug "Bundler is already installed"
bundle --version
else
pmd_ci_log_info "Installing bundler..."
gem install bundler
fi
rm -f .bundle/config
bundle config set --local path vendor/bundle
bundle config set --local with release_notes_preprocessing
bundle install
}
#
# Generate a new baseline and upload it to pmd-code.org
#
function regression_tester_uploadBaseline() {
local pmdcodeUrl="https://pmd-code.org/pmd-regression-tester/"
local baseline_branch="${PMD_CI_BRANCH:-$PMD_CI_TAG}"
pmd_ci_log_debug "${FUNCNAME[0]} branch=${baseline_branch}"
pmd_ci_log_info "Generating and uploading baseline for pmdtester (${baseline_branch})..."
pushd ..
rm -f .bundle/config
bundle config set --local gemfile pmd/Gemfile
bundle exec pmdtester \
--mode single \
--local-git-repo ./pmd \
--patch-branch "${baseline_branch}" \
--patch-config ./pmd/.ci/files/all-regression-rules.xml \
--list-of-project ./pmd/.ci/files/project-list.xml --html-flag \
--threads "$(nproc)" \
--error-recovery
pushd target/reports || { echo "Directory 'target/reports' doesn't exist"; exit 1; }
BRANCH_FILENAME="${baseline_branch/\//_}"
zip -q -r "${BRANCH_FILENAME}-baseline.zip" "${BRANCH_FILENAME}/"
# ssh-key for pmd-code.org is setup already by pmd_ci_setup_secrets_ssh
scp "${BRANCH_FILENAME}-baseline.zip" pmd@pmd-code.org:/httpdocs/pmd-regression-tester/
pmd_ci_log_success "Successfully uploaded ${BRANCH_FILENAME}-baseline.zip to ${pmdcodeUrl}"
popd || exit 1
popd || exit 1
}
#
# Execute danger, which executes pmd-regression-tester (via Dangerfile).
#
function regression_tester_executeDanger() {
pmd_ci_log_debug "${FUNCNAME[0]}"
# git clone initially only fetched with depth 2. Danger and regression tester
# need more history, so we'll fetch more here
# and create local branches as well (${PMD_CI_BRANCH} and pr-fetch)
pmd_ci_log_info "Fetching 25 commits for ${PMD_CI_BRANCH} and pull/${PMD_CI_PULL_REQUEST_NUMBER}/head"
git fetch --no-tags --depth=25 origin "${PMD_CI_BRANCH}:${PMD_CI_BRANCH}" "pull/${PMD_CI_PULL_REQUEST_NUMBER}/head:pr-fetch"
# if the PR is older, base might have advanced more than 25 commits... fetch more, up to 150
for i in $(seq 1 3); do
if [ -z "$( git merge-base "${PMD_CI_BRANCH}" "pr-fetch" )" ]; then
pmd_ci_log_info "No merge-base yet - fetching more commits... (try $i)"
git fetch --no-tags --deepen=50 origin "${PMD_CI_BRANCH}:" "pull/${PMD_CI_PULL_REQUEST_NUMBER}/head:pr-fetch"
fi
done
pmd_ci_log_info "Merge base is: $( git merge-base "${PMD_CI_BRANCH}" "pr-fetch" )"
pmd_ci_log_info "Running danger on branch ${PMD_CI_BRANCH}"
bundle exec danger --verbose
pmd_ci_log_success "Executed danger successfully"
}
-14
View File
@@ -1,14 +0,0 @@
* text=auto
*.java text
*.xml text
*.jjt text
*.jj text
*.g4 text
*.md text
*.sh text eol=lf
*.bat text eol=crlf
mvnw.cmd text eol=crlf
*.png -text
*.jpg -text
*.svgz -text
*.jar -text
-5
View File
@@ -1,5 +0,0 @@
#
# https://docs.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository
#
github: pmd
open_collective: pmd
@@ -1,123 +0,0 @@
Added line: 9032
Added line: 4984
Added line: 8296
Added line: 5358
Added line: 3781
Added line: 8576
Added line: 638
---
Added line: 4863
Added line: 4881
Added line: 1053
name: Rule violation (false-positive)
Added line: 2892
Added line: 419
Added line: 5445
Added line: 9875
Added line: 2837
Added line: 2727
about: Let us know about a false-positive (a violation is reported on code that is not problematic)
Added line: 2040
labels: 'a:false-positive'
Added line: 4646
Added line: 5328
Added line: 5556
Added line: 1343
Added line: 8597
Added line: 4832
Added line: 6373
Added line: 59
Added line: 9107
Added line: 679
Added line: 7562
Added line: 4826
Added line: 3685
Added line: 3413
---
Added line: 8862
Added line: 3581
Added line: 3115
Added line: 8214
Added line: 8330
Added line: 5011
Added line: 4960
Added line: 5711
Added line: 715
Added line: 5443
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex] -->
Added line: 2178
Added line: 3165
Added line: 2575
Added line: 8688
**Affects PMD Version:**
Added line: 3366
Added line: 3430
Added line: 8099
Added line: 1991
**Rule:**
Added line: 812
Added line: 6221
Added line: 8729
Added line: 3231
Added line: 8470
Added line: 782
Added line: 8999
Please provide the rule name and a link to the rule documentation:
Added line: 5171
Added line: 4827
Added line: 9685
Added line: 7949
Added line: 5263
Added line: 4070
Added line: 9530
Added line: 5361
Added line: 8332
Added line: 8267
Added line: 1113
Added line: 5193
Added line: 8746
<https://docs.pmd-code.org/latest/pmd_rules_XXX_XXX.html#XXX>
Added line: 3665
Added line: 5900
**Description:**
Added line: 3935
**Code Sample demonstrating the issue:**
```java
Added line: 1406
Added line: 1622
Added line: 3566
Added line: 9658
Added line: 1428
Added line: 5834
```
Added line: 7530
Added line: 2119
Added line: 9424
Added line: 6322
Added line: 971
Added line: 2904
Added line: 5053
**Expected outcome:**
Added line: 4245
Added line: 7901
Added line: 1581
Added line: 1774
Added line: 4867
PMD reports a violation at line ..., but that's wrong. That's a false positive.
Added line: 1008
Added line: 8833
Added line: 4235
**Running PMD through:** *[CLI | Ant | Maven | Gradle | Designer | Other]*
Added line: 2257
Added line: 250
Added line: 9807
Added line: 2685
@@ -1,119 +0,0 @@
---
Added line: 2036
Added line: 4210
Added line: 227
name: Rule violation (false-negative)
Added line: 5393
about: Let us know about a false-negative (no violation is reported on problematic code)
Added line: 3768
Added line: 2929
Added line: 336
Added line: 5100
Added line: 2776
title: ''
labels: 'a:false-negative'
Added line: 4378
Added line: 407
assignees: ''
---
Added line: 9712
Added line: 9804
Added line: 1425
Added line: 5548
Added line: 5560
Added line: 3441
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex] -->
Added line: 2963
Added line: 7108
Added line: 2911
**Affects PMD Version:**
Added line: 1130
Added line: 9851
Added line: 5619
Added line: 9719
Added line: 9518
Added line: 3632
**Rule:**
Added line: 9277
Added line: 7944
Added line: 8135
Added line: 3267
Added line: 7738
Added line: 672
Please provide the rule name and a link to the rule documentation:
Added line: 1330
Added line: 6999
Added line: 876
Added line: 9910
Added line: 8195
Added line: 1054
Added line: 8073
Added line: 8012
Added line: 4868
Added line: 8284
<https://docs.pmd-code.org/latest/pmd_rules_XXX_XXX.html#XXX>
Added line: 743
Added line: 7518
Added line: 7900
Added line: 2604
Added line: 1081
Added line: 907
Added line: 6001
Added line: 3968
Added line: 494
Added line: 5240
Added line: 2555
Added line: 3475
**Description:**
Added line: 8125
Added line: 8447
**Code Sample demonstrating the issue:**
Added line: 1790
Added line: 8745
Added line: 1553
```java
Added line: 9167
Added line: 2857
```
**Expected outcome:**
Added line: 6821
Added line: 4778
Added line: 9347
Added line: 1381
Added line: 1941
Added line: 2406
Added line: 667
PMD should report a violation at line ..., but doesn't. This is a false-negative.
Added line: 4537
Added line: 7420
Added line: 1685
Added line: 1244
Added line: 8605
Added line: 2527
Added line: 5885
Added line: 1636
**Running PMD through:** *[CLI | Ant | Maven | Gradle | Designer | Other]*
Added line: 4259
Added line: 2521
Added line: 5929
Added line: 7218
Added line: 532
Added line: 7458
Added line: 6443
Added line: 8367
Added line: 2443
Added line: 877
Added line: 9012
Added line: 2250
Added line: 7945
-118
View File
@@ -1,118 +0,0 @@
Added line: 8008
---
Added line: 1876
Added line: 1268
Added line: 3166
Added line: 3540
Added line: 1506
Added line: 4949
Added line: 8344
Added line: 4443
name: New Rule
about: You have an idea for a new rule? Great!
Added line: 1249
Added line: 509
Added line: 7136
Added line: 7138
Added line: 3547
title: ''
Added line: 8854
Added line: 7303
labels: 'a:new-rule'
assignees: ''
Added line: 7663
Added line: 4379
Added line: 3661
Added line: 5641
Added line: 1266
Added line: 2763
Added line: 7480
Added line: 1665
Added line: 7945
Added line: 8173
Added line: 1305
---
Added line: 1184
Added line: 783
Added line: 1036
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex] -->
Added line: 1687
Added line: 9420
Added line: 9768
Added line: 6958
Added line: 3107
Added line: 4488
Added line: 5921
Added line: 8999
Added line: 3663
Added line: 9343
Added line: 8596
Added line: 4528
Added line: 7451
Added line: 9562
Added line: 2129
Added line: 7611
Added line: 3602
Added line: 9038
**Proposed Category:** One of [Best Practices | Code Style | Design | Documentation | Error Prone | Multithreading | Performance | Security]
Added line: 141
Added line: 9794
Added line: 3369
Added line: 9168
Added line: 3697
Added line: 6694
Added line: 691
Added line: 8738
Added line: 9018
Added line: 4391
Added line: 108
Added line: 4367
Added line: 5549
Added line: 6995
Added line: 4529
**Code Sample:** This should include code, that should be flagged by the rule. If possible, the "correct" code
Added line: 9295
Added line: 4422
Added line: 4374
Added line: 8540
Added line: 689
Added line: 5886
Added line: 4050
Added line: 972
Added line: 3942
according to this new rule should also be demonstrated.
Added line: 3608
Added line: 1933
Added line: 2038
Added line: 7483
Added line: 4764
Added line: 8361
Added line: 6882
Added line: 6080
Added line: 4487
**Possible Properties:**
Added line: 5330
Added line: 6096
Added line: 8622
Added line: 4534
Added line: 7766
Added line: 8069
Added line: 6191
Added line: 7601
* Should this rule be customizable via properties?
Added line: 4112
Added line: 3265
Added line: 200
Added line: 6273
Added line: 7004
Added line: 7373
-109
View File
@@ -1,109 +0,0 @@
Added line: 6559
Added line: 7645
---
Added line: 7179
Added line: 4967
Added line: 9013
Added line: 7132
Added line: 1160
Added line: 3987
Added line: 7629
Added line: 4406
Added line: 7359
Added line: 930
Added line: 3460
Added line: 64
Added line: 50
Added line: 5031
name: Feature request
Added line: 3860
Added line: 954
Added line: 605
about: Suggest an idea for this project
Added line: 9836
Added line: 7559
Added line: 8444
Added line: 840
title: ''
Added line: 1809
Added line: 5258
Added line: 2334
Added line: 3166
labels: 'an:enhancement'
Added line: 1482
Added line: 4357
Added line: 1404
Added line: 6594
Added line: 4917
Added line: 5823
Added line: 2230
assignees: ''
Added line: 7536
Added line: 5103
Added line: 3902
Added line: 492
Added line: 3161
---
**Is your feature request related to a problem? Please describe.**
Added line: 834
Added line: 2572
Added line: 4912
Added line: 2318
Added line: 22
Added line: 3312
Added line: 8830
Added line: 3142
Added line: 5843
Added line: 4808
Added line: 2269
Added line: 5755
Added line: 7627
Added line: 576
Added line: 7077
Added line: 3997
Added line: 4922
Added line: 6340
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Added line: 2533
Added line: 8768
Added line: 3704
A clear and concise description of what you want to happen.
Added line: 5417
Added line: 5871
Added line: 3411
Added line: 2663
Added line: 6534
Added line: 3280
Added line: 69
Added line: 4552
Added line: 7229
Added line: 3992
Added line: 7256
**Describe alternatives you've considered**
Added line: 9063
Added line: 5636
Added line: 137
Added line: 1672
Added line: 7168
Added line: 3765
Added line: 2224
Added line: 2718
Added line: 6811
Added line: 3957
Added line: 7792
A clear and concise description of any alternative solutions or features you've considered.
Added line: 8275
Added line: 5581
Added line: 218
Added line: 54
Added line: 9521
**Additional context**
Add any other context about the feature request here.
Added line: 1882
Added line: 9677
Added line: 1022
Added line: 7995
-132
View File
@@ -1,132 +0,0 @@
---
Added line: 7163
Added line: 6618
Added line: 6861
Added line: 2942
Added line: 8158
Added line: 6336
name: Bug report
Added line: 9925
Added line: 9757
about: Create a report to help us improve
Added line: 33
Added line: 5956
title: ''
Added line: 2940
Added line: 1892
labels: 'a:bug'
assignees: ''
Added line: 4373
Added line: 1277
Added line: 5367
Added line: 8360
---
Added line: 5857
Added line: 3641
Added line: 8564
Added line: 5755
Added line: 1866
Added line: 2958
Added line: 6216
Added line: 6953
If not specific to a language, you can use [core]. -->
Added line: 8422
**Affects PMD Version:**
Added line: 9
Added line: 9739
Make sure, to test with the latest PMD version.
Added line: 9684
Added line: 3625
Added line: 2132
**Description:**
Added line: 3063
Added line: 3495
Added line: 8522
Added line: 7768
Added line: 4591
Added line: 7657
A clear and concise description of what the bug is.
Added line: 7674
Added line: 3018
Added line: 3523
Added line: 6119
**Exception Stacktrace:**
Added line: 2639
Added line: 50
Added line: 3420
```
Added line: 340
Added line: 4118
# Copy-paste the stack trace here
```
**Code Sample demonstrating the issue:**
Added line: 4378
Added line: 2003
Added line: 7525
Added line: 1770
Added line: 819
Added line: 4668
Added line: 7062
Added line: 2213
Added line: 9134
Added line: 5477
Added line: 3791
Added line: 1072
Added line: 5265
```java
Added line: 9934
Added line: 1221
Added line: 144
Added line: 6855
```
Added line: 7445
Added line: 1398
**Steps to reproduce:**
Added line: 3258
Added line: 8918
Added line: 2863
Added line: 4767
Please provide detailed steps for how we can reproduce the bug.
Added line: 7324
1. ... (e.g. if you're using maven: `mvn clean verify`)
Added line: 8777
Added line: 4718
Added line: 486
Added line: 3912
Added line: 1625
Added line: 9318
Added line: 2355
2. ...
Added line: 6166
Added line: 4716
Added line: 654
Added line: 8612
Added line: 7142
Added line: 1363
Added line: 3087
Added line: 3566
Added line: 484
Added line: 4035
**Running PMD through:** *[CLI | Ant | Maven | Gradle | Designer | Other]*
Added line: 3112
Added line: 9169
Added line: 3475
Added line: 8337
Added line: 1293
Added line: 9095
<!-- If relevant, also include your JDK and OS information, e.g. for ClassNotFoundException, LinkageError, reflection failures, etc. -->
Added line: 4859
Added line: 6054
Added line: 6864
Added line: 7737
-11
View File
@@ -1,11 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Question
url: https://github.com/pmd/pmd/discussions?discussions_q=category%3AQ%26A
about: Feel free to ask any question about PMD and its usage
- name: PMD Designer Issues
url: https://github.com/pmd/pmd-designer/issues
about: Issues about the rule designer
- name: PMD Eclipse Plugin Issues
url: https://github.com/pmd/pmd-eclipse-plugin/issues
about: Issues about the PMD Eclipse Plugin
-108
View File
@@ -1,108 +0,0 @@
Added line: 4668
Added line: 7342
Added line: 645
Added line: 953
## Describe the PR
Added line: 1116
Added line: 1176
Added line: 8809
Added line: 5548
Added line: 4708
Added line: 3316
Added line: 9441
Added line: 5371
Added line: 8243
Added line: 7169
Added line: 6056
Added line: 9045
Added line: 5078
Added line: 176
Added line: 6174
Added line: 5742
Added line: 2568
Added line: 5271
Added line: 9953
Added line: 3920
Added line: 3102
Added line: 8277
Added line: 8774
Added line: 2491
Added line: 8878
<!-- A clear and concise description of the bug the PR fixes or the feature the PR introduces. -->
Added line: 6243
Added line: 6136
Added line: 2027
Added line: 883
Added line: 8919
Added line: 9637
Added line: 7519
Added line: 95
Added line: 2168
## Related issues
Added line: 8807
Added line: 3834
Added line: 5473
Added line: 9396
Added line: 1833
<!-- PR relates to issues in the `pmd` repo: -->
Added line: 3916
Added line: 9129
Added line: 2330
Added line: 8868
- Fixes #
Added line: 850
Added line: 313
Added line: 6588
Added line: 7355
Added line: 6171
Added line: 1836
Added line: 2404
Added line: 5026
Added line: 752
Added line: 8039
Added line: 8031
Added line: 3383
Added line: 1155
Added line: 7107
Added line: 7111
Added line: 7263
<!-- If you feel like you can help to check off the following tasks, that'd be great. If not, don't worry - we will take care of it. -->
Added line: 490
Added line: 2833
Added line: 9450
Added line: 6040
Added line: 1128
- [ ] Added unit tests for fixed bug/feature
Added line: 1293
Added line: 9752
Added line: 7365
Added line: 6415
Added line: 1369
Added line: 3745
Added line: 7506
- [ ] Passing all unit tests
- [ ] Complete build `./mvnw clean verify` passes (checked automatically by github actions)
Added line: 9397
Added line: 4392
Added line: 7361
Added line: 6623
Added line: 8770
Added line: 385
Added line: 1491
Added line: 6272
Added line: 9766
Added line: 223
Added line: 2967
Added line: 5136
Added line: 5049
- [ ] Added (in-code) documentation (if needed)
Added line: 9332
Added line: 5216
Added line: 9011
-23
View File
@@ -1,23 +0,0 @@
version: 2
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "bundler"
directories:
- "/"
- "/docs"
schedule:
interval: "weekly"
groups:
all-gems:
patterns: [ "*" ]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
all-actions:
patterns: [ "*" ]
-86
View File
@@ -1,86 +0,0 @@
name: build
on:
push:
branches:
- main
tags:
- '**'
pull_request:
merge_group:
schedule:
# build it monthly: At 04:00 on day-of-month 1.
- cron: '0 4 1 * *'
workflow_dispatch:
inputs:
build_cli_dist_only:
description: "Build only modules cli and dist"
required: true
type: boolean
default: false
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
# read to fetch code (actions/checkout)
# write to push code to gh-pages, create releases
# note: forked repositories will have maximum read access
contents: write
continue-on-error: false
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.gradle/caches
~/.cache
~/work/pmd/target/repositories
vendor/bundle
key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
v3-${{ runner.os }}-
- name: Set up Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/27/scripts" >> $GITHUB_ENV
- name: Check Environment
shell: bash
run: |
f=check-environment.sh; \
mkdir -p .ci && \
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
chmod 755 .ci/$f && \
.ci/$f
- name: Build
run: .ci/build.sh
shell: bash
env:
BUILD_CLI_DIST_ONLY: ${{ inputs.build_cli_dist_only }}
PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Workaround actions/upload-artifact#176
run: |
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
- name: Upload regression tester report
uses: actions/upload-artifact@v4
with:
name: pmd-regression-tester
path: ${{ env.artifacts_path }}/target/pr-*-diff-report-*.tar.gz
if-no-files-found: ignore
-32
View File
@@ -1,32 +0,0 @@
name: git-repo-sync
on:
push:
branches:
- main
tags:
- '**'
workflow_dispatch:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/27/scripts" >> $GITHUB_ENV
- name: Sync
run: .ci/git-repo-sync.sh
shell: bash
env:
PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-58
View File
@@ -1,58 +0,0 @@
name: troubleshooting
on: workflow_dispatch
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
matrix:
#os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.gradle/caches
~/.cache
~/work/pmd/target/repositories
vendor/bundle
key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
v3-${{ runner.os }}-
- name: Set up Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/27/scripts" >> $GITHUB_ENV
- name: Check Environment
shell: bash
run: |
f=check-environment.sh; \
mkdir -p .ci && \
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
chmod 755 .ci/$f && \
.ci/$f
- name: Build
run: |
f=openjdk.bash; \
mkdir -p .ci/inc && \
( [ -e .ci/inc/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/inc/$f" > ".ci/inc/$f" ) && \
source .ci/inc/$f ; \
pmd_ci_openjdk_install_adoptium 11 ; \
pmd_ci_openjdk_setdefault 11
shell: bash
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
-24
View File
@@ -1,24 +0,0 @@
target/
bin/
.project
.classpath
.checkstyle
.pmd
.pmdruleset.xml
.ruleset
.settings/
*.iml
.idea
*.patch
*/src/site/site.xml
pmd-core/dependency-reduced-pom.xml
.bundle
vendor
.DS_Store
# node modules for https://allcontributors.org/docs/en/cli/installation
node_modules
# rule docs are generated
docs/pages/pmd/rules
.history/*
-19
View File
@@ -1,19 +0,0 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
-133
View File
@@ -1,133 +0,0 @@
# How to build PMD
PMD uses [Maven](https://maven.apache.org/) and requires at least Java 11 for building.
Added line: 2738
Added line: 2088
You can get Java 11 from [Oracle](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
or from [AdoptOpenJdk](https://adoptopenjdk.net/).
Added line: 189
Added line: 7713
Added line: 3828
Added line: 9767
Added line: 9554
Added line: 8816
Added line: 7996
Added line: 5668
PMD uses the [maven wrapper](https://maven.apache.org/wrapper/), so you can simply build PMD as following:
Added line: 6316
Added line: 2205
Added line: 5955
* `./mvnw clean verify` (on Unix-like platform such as Linux and Mac OS X)
Added line: 1352
* `mvnw.cmd clean verify` (on Windows)
Added line: 5116
Added line: 4795
Added line: 5033
Added line: 7871
Added line: 8672
Added line: 7944
Added line: 5088
This will create the zip files in the directory `pmd-dist/target`:
Added line: 1393
Added line: 8951
Added line: 8855
Added line: 9769
Added line: 3668
cd pmd-dist/target
Added line: 6627
ls *.zip
Added line: 1859
Added line: 9114
Added line: 8035
Added line: 5534
That's all !
Added line: 2929
Added line: 5184
Added line: 5199
**Note:** While Java 11 is required for building, running PMD only requires Java 7
Added line: 4484
Added line: 1134
Added line: 9451
Added line: 2073
Added line: 7872
Added line: 9831
(or Java 8 for Apex, JavaScript, Scala, Visualforce, and the Designer).
Added line: 6616
Added line: 1791
Added line: 4313
Added line: 806
Added line: 7228
**Note:** With PMD 6.24.0, we are creating [Reproducible Builds](https://reproducible-builds.org/). Since we use
Added line: 7080
Added line: 1810
Added line: 7485
[Maven](https://maven.apache.org/guides/mini/guide-reproducible-builds.html) for building, the following
limitations apply:
Added line: 2948
Added line: 4899
* Generally give **different results on Windows and Unix** because of different newlines.
Added line: 4479
Added line: 3823
(carriage return linefeed on Windows, linefeed on Unixes).
Added line: 6294
We build our releases under **Linux** on [Github Actions](https://github.com/pmd/pmd/actions).
Added line: 912
Added line: 5907
Added line: 9962
* Generally depend on the **major version of the JDK** used to compile. (Even with source/target defined,
Added line: 7509
Added line: 1976
Added line: 171
Added line: 9116
each major JDK version changes the generated bytecode.).
Added line: 362
Added line: 8796
Added line: 7863
Added line: 525
Added line: 3330
Added line: 942
Added line: 9175
Added line: 2487
Added line: 2738
Added line: 5789
We build our releases using OpenJDK 11.
Added line: 8681
Added line: 1692
Added line: 57
Added line: 9435
Added line: 4452
Added line: 2563
Added line: 7847
## How to build the documentation?
Added line: 252
Added line: 8578
cd docs
Added line: 1191
Added line: 2713
bundle install # once
Added line: 991
Added line: 3730
Added line: 7070
Added line: 6623
Added line: 6885
You'll find the built site in the directory `_site/`.
Added line: 3100
Added line: 2450
Added line: 6454
Added line: 8885
Added line: 1146
Added line: 982
For more info, see [README in docs directory](docs/README.md).
-165
View File
@@ -1,165 +0,0 @@
# How to contribute to PMD
Added line: 9638
Added line: 7013
Added line: 5282
Added line: 8732
Added line: 4005
Added line: 8445
Added line: 1817
Please note that this project is released with a Contributor Code of Conduct.
Added line: 2253
Added line: 9476
By participating in this project you agree to abide by its terms.
Added line: 9650
Added line: 9346
Added line: 176
You can find the code of conduct in the file [code_of_conduct.md](code_of_conduct.md).
Added line: 2336
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Added line: 485
Added line: 7195
## Pull requests
Added line: 9917
Added line: 9732
* Please create your pull request against the `main` branch. We will rebase/merge it to the maintenance
Added line: 9567
Added line: 3042
branches, if necessary.
Added line: 5753
Added line: 5082
* We are using [checkstyle](http://checkstyle.sourceforge.net/) to enforce a common code style.
Added line: 6374
Added line: 6736
The check is integrated into the default build - so, make sure, you can [build PMD](BUILDING.md) without errors.
See [code style](#code-style) for more info.
Added line: 5433
Added line: 9324
Added line: 9717
Added line: 9572
Added line: 4760
Added line: 3324
Added line: 6207
Added line: 7939
## Bug reports
Added line: 687
Added line: 648
Added line: 860
Added line: 5964
Added line: 7731
Added line: 4598
We use the issue tracker on Github. Please report new bugs at <https://github.com/pmd/pmd/issues>.
Added line: 1689
When filing a bug report, please provide as much information as possible, so that we can reproduce the issue:
Added line: 4335
Added line: 7171
* The name of the rule, that is buggy
Added line: 6812
Added line: 6274
Added line: 6782
* A code snippet, which triggers a false positive/negative or crash
* How do you execute PMD? (command line, ant, maven, gradle, other)
Added line: 6124
## Documentation
Added line: 3615
Added line: 7433
Added line: 294
There is some documentation available under <https://docs.pmd-code.org/latest>. Feel free to create a bug report if
Added line: 4105
Added line: 4326
Added line: 7171
documentation is missing, incomplete or outdated. See [Bug reports](#bug-reports).
Added line: 7347
Added line: 7759
The documentation is generated as a Jekyll site, the source is available at: <https://github.com/pmd/pmd/tree/main/docs>. You can find build instructions there.
For more on contributing documentation check <https://docs.pmd-code.org/latest/pmd_devdocs_writing_documentation.html>
Added line: 3086
Added line: 3787
Added line: 7401
Added line: 2504
## Questions
Added line: 1299
There are various channels, on which you can ask questions:
Added line: 7287
* On [StackOverflow](https://stackoverflow.com/questions/tagged/pmd): Make sure, to tag your question with "pmd".
Added line: 4923
Added line: 9267
Added line: 3668
* Create a new discussion for your question at <https://github.com/pmd/pmd/discussions>.
Added line: 1721
Added line: 312
## Code Style
Added line: 6860
Added line: 6132
PMD uses [checkstyle](http://checkstyle.sourceforge.net/) to enforce a common code style.
See [pmd-checkstyle-config.xml](https://github.com/pmd/build-tools/blob/main/src/main/resources/net/sourceforge/pmd/pmd-checkstyle-config.xml) for the configuration and
Added line: 7171
Added line: 1453
Added line: 1556
Added line: 3942
[the eclipse configuration files](https://github.com/pmd/build-tools/tree/main/eclipse) that can
be imported into a fresh workspace.
Added line: 581
Added line: 8163
Added line: 7384
Added line: 3400
## Add yourself as contributor
Added line: 3401
Added line: 6321
Added line: 8035
Added line: 3292
Added line: 926
Added line: 8461
We use [All Contributors](https://allcontributors.org/en).
To add yourself to the table of contributors, follow the
[bot usage instructions](https://allcontributors.org/docs/en/bot/usage) ;).
Or use the CLI:
Added line: 9829
1. Install the CLI: `npm i` (in PMD's top level directory)
Added line: 4344
Added line: 6847
Added line: 5588
2. Add yourself: `npx all-contributors add <username> <contribution>`
Added line: 2387
Where `username` is your GitHub username and `contribution` is a `,`-separated list
Added line: 163
Added line: 3108
Added line: 8975
Added line: 589
Added line: 3968
Added line: 2583
Added line: 8052
of contributions. See [Emoji Key](https://allcontributors.org/docs/en/emoji-key) for a list
of valid types. Common types are: "code", "doc", "bug", "blog", "talk", "test", "tutorial".
Added line: 153
Added line: 8349
See also [cli documentation](https://allcontributors.org/docs/en/cli/usage)
Added line: 7606
-98
View File
@@ -1,98 +0,0 @@
require 'pmdtester'
require 'time'
require 'logger'
require 'fileutils'
require 'etc'
@logger = Logger.new(STDOUT)
def get_args(base_branch, autogen = true, patch_config = './pmd/.ci/files/all-regression-rules.xml')
['--local-git-repo', './pmd',
'--list-of-project', './pmd/.ci/files/project-list.xml',
'--base-branch', base_branch,
'--patch-branch', 'HEAD',
'--patch-config', patch_config,
'--mode', 'online',
autogen ? '--auto-gen-config' : '--filter-with-patch-config',
'--keep-reports',
'--error-recovery',
'--baseline-download-url', 'https://pmd-code.org/pmd-regression-tester/',
'--threads', Etc.nprocessors.to_s,
# '--debug',
]
end
def run_pmdtester
Dir.chdir('..') do
begin
@base_branch = ENV['PMD_CI_BRANCH']
@logger.info "\n\n--------------------------------------"
@logger.info "Run against PR base #{@base_branch}"
@summary = PmdTester::Runner.new(get_args(@base_branch)).run
unless Dir.exist?('target/reports/diff')
message("No regression tested rules have been changed.", sticky: true)
return
end
# move the generated report out of the way
FileUtils.mv 'target/reports/diff', 'target/diff1'
message1 = create_message
# run against main branch (if the PR is not already against main)
unless ENV['PMD_CI_BRANCH'] == 'main'
@base_branch = 'main'
@logger.info "\n\n--------------------------------------"
@logger.info "Run against #{@base_branch}"
@summary = PmdTester::Runner.new(get_args(@base_branch, false, 'target/diff1/patch_config.xml')).run
# move the generated report out of the way
FileUtils.mv 'target/reports/diff', 'target/diff2'
message2 = create_message
end
tar_report
message1 += "[Download full report as build artifact](#{ENV['PMD_CI_JOB_URL']}?pr=#{ENV['PMD_CI_PULL_REQUEST_NUMBER']})"
# set value of sticky to true and the message is kept after new commits are submitted to the PR
message(message1, sticky: true)
if message2
message2 += "[Download full report as build artifact](#{ENV['PMD_CI_JOB_URL']}?pr=#{ENV['PMD_CI_PULL_REQUEST_NUMBER']})"
# set value of sticky to true and the message is kept after new commits are submitted to the PR
message(message2, sticky: true)
end
rescue StandardError => e
warn("Running pmdtester failed, this message is mainly used to remind the maintainers of PMD.")
@logger.error "Running pmdtester failed: #{e.inspect}"
end
end
end
def create_message
"Compared to #{@base_branch}:\n"\
"This changeset " \
"changes #{@summary[:violations][:changed]} violations,\n" \
"introduces #{@summary[:violations][:new]} new violations, " \
"#{@summary[:errors][:new]} new errors and " \
"#{@summary[:configerrors][:new]} new configuration errors,\n" \
"removes #{@summary[:violations][:removed]} violations, "\
"#{@summary[:errors][:removed]} errors and " \
"#{@summary[:configerrors][:removed]} configuration errors.\n"
end
def tar_report
Dir.chdir('target') do
tar_filename = "pr-#{ENV['PMD_CI_PULL_REQUEST_NUMBER']}-diff-report-#{Time.now.strftime("%Y-%m-%dT%H-%M-%SZ")}.tar.gz"
`tar czf #{tar_filename} diff1/ diff2/`
tar_size = (10 * File.size(tar_filename) / 1024 / 1024)/10.0
@logger.info "Created file #{tar_filename} (#{tar_size}mb)"
end
end
# Perform regression testing
run_pmdtester
# vim: syntax=ruby
-19
View File
@@ -1,19 +0,0 @@
source 'https://rubygems.org/'
# bleeding edge from git
#gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git', branch: 'main'
gem 'pmdtester'
gem 'danger'
# This group is only needed for rendering release notes (docs/render_release_notes.rb)
# this happens during release (.ci/build.sh and do-release.sh)
# but also during regular builds (.ci/build.sh)
group :release_notes_preprocessing do
gem 'liquid'
gem 'safe_yaml'
gem 'rouge'
gem 'bigdecimal'
end
# vim: syntax=ruby

Some files were not shown because too many files have changed in this diff Show More