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
281 changed files with 15324 additions and 8602 deletions

View File

@ -3,12 +3,10 @@
<classpathentry kind="src" path="regress"/>
<classpathentry kind="src" path="rulesets"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="var" path="JRE_LIB"/>
<classpathentry kind="var" path="ANT_HOME/ant.jar"/>
<classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
<classpathentry kind="lib" path="lib/junit-4.4.jar"/>
<classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.jdt_3.1.0.jar"/>
<classpathentry kind="var" path="JDK1.5_HOME/lib/tools.jar"/>
<classpathentry kind="lib" path="lib/jaxen-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/asm-3.1.jar"/>
<classpathentry kind="lib" path="lib/asm-3.2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build"/>
</classpath>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>pmd4jsp-cvs</name>
<name>pmd-4.3.x</name>
<comment></comment>
<projects>
</projects>
@ -10,19 +10,8 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.maven.ide.eclipse.maven2Builder.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -1,4 +1,4 @@
Copyright (c) 2003, InfoEther, LLC
Copyright (c) 2003-2009, InfoEther, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@ -1,8 +1,8 @@
@echo off
set TOPDIR=%~dp0/..
set VERSION=4.2
set VERSION=4.3
set PMDJAR=%TOPDIR%/lib/pmd-%VERSION%.jar
set JARPATH=%TOPDIR%/lib/asm-3.1.jar;%TOPDIR%/lib/jaxen-1.1.1.jar
set JARPATH=%TOPDIR%/lib/asm-3.2.jar;%TOPDIR%/lib/jaxen-1.1.1.jar
set OPTS=
set MAIN_CLASS=net.sourceforge.pmd.util.viewer.Viewer

4
pmd/bin/bgastviewer.sh Executable file → Normal file
View File

@ -1,7 +1,7 @@
TOPDIR=..
VERSION=4.2
VERSION=4.3
PMDJAR=$TOPDIR/lib/pmd-$VERSION.jar
JARPATH=$TOPDIR/lib/asm-3.1.jar:$TOPDIR/lib/jaxen-1.1.1.jar
JARPATH=$TOPDIR/lib/asm-3.2.jar:$TOPDIR/lib/jaxen-1.1.1.jar
OPTS=
MAIN_CLASS=net.sourceforge.pmd.util.viewer.Viewer

View File

@ -7,14 +7,16 @@
<property name="dir.src" value="src/" />
<property name="dir.build" value="build/" />
<property name="dir.target" value="target/" />
<property name="dir.release" value="release/" />
<property name="dir.rulesets" value="rulesets/" />
<property name="dir.regress" value="regress/" />
<property name="version" value="4.2" />
<property name="version" value="4.3" />
<property name="asm.version" value="3.1" />
<property name="asm.version" value="3.2" />
<property name="jaxen.version" value="1.1.1" />
<property name="junit.version" value="4.4" />
<property name="retroweaver.version" value="2.0.5" />
<property name="javacc-home.path" value="${dir.lib}" />
<!--Settings-->
<property name="outputTestResultsToFile" value="true" />
@ -31,6 +33,7 @@
<target name="delete" description="Deletes the build directory and the pmd-x.x jar file.">
<delete dir="${dir.build}" />
<delete dir="${dir.target}" />
<delete dir="${dir.release}" />
<delete file="${dir.lib}/pmd-${version}.jar" />
<delete file="${dir.lib}/pmd-src-${version}.jar" />
<delete file="${dir.lib}/pmd-test-${version}.jar" />
@ -70,12 +73,19 @@
</target>
<target name="jar" depends="copy,compile" description="Jars up the classes and rulesets">
<jar jarfile="${dir.lib}/pmd-${version}.jar" includes="net/sourceforge/pmd/**/**,test/net/sourceforge/pmd/testframework/**/**,rulesets/**" basedir="${dir.build}">
<jar jarfile="${dir.lib}/pmd-${version}.jar">
<fileset dir="${dir.build}" includes="net/sourceforge/pmd/**/**,test/net/sourceforge/pmd/testframework/**/**,rulesets/**"/>
<zipfileset dir="etc" includes="ruleset.dtd,ruleset_xml_schema.xsd" prefix="rulesets"/>
<manifest>
<attribute name="Main-Class" value="net.sourceforge.pmd.PMD" />
<attribute name="Class-Path" value="jaxen-${jaxen.version}.jar asm-${asm.version}.jar" />
</manifest>
</jar>
<jar jarfile="${dir.lib}/pmd-test-${version}.jar"
includes="test/net/sourceforge/pmd/**/**"
excludes="test/net/sourceforge/pmd/testframework/**/**"
basedir="${dir.build}" />
</target>
<taskdef name="retroweaver" classname="net.sourceforge.retroweaver.ant.RetroWeaverTask">
@ -125,10 +135,6 @@
<classpath refid="retroweaverclasspath" />
</retroweaver>
<jar jarfile="${dir.lib}/pmd-test-${version}.jar"
includes="test/net/sourceforge/pmd/**/**,test/net/sourceforge/pmd/testframework/**/**"
excludes="test/net/sourceforge/pmd/testframework/**/**" basedir="${dir.build}" />
<retroweaver inputjar="${dir.lib}/pmd-test-${version}.jar" outputjar="${dir.lib14}/pmd14-test-${version}.jar" target="1.4" failonerror="true" verify="true">
<classpath refid="retroweaverclasspath" />
</retroweaver>
@ -141,11 +147,8 @@
<target name="pmd" description="Runs PMD" depends="copy, compile">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="dependencies.path" />
<pmd rulesetfiles="unusedcode" shortFilenames="true">
<classpath>
<path refid="dependencies.path" />
</classpath>
<formatter type="csv" toFile="rpt.csv" toConsole="true" linkPrefix="http://pmd.sf.net/xref/" />
<fileset dir="/usr/local/java/src/java/net/">
<fileset dir="src/">
<include name="**/*.java" />
</fileset>
</pmd>
@ -154,15 +157,13 @@
<target name="pmdOnPmd" description="Runs PMD on PMD" depends="copy, compile">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="dependencies.path" />
<pmd rulesetfiles="${dir.rulesets}internal/dogfood.xml" shortFilenames="true" targetjdk="1.5">
<classpath>
<path refid="dependencies.path" />
</classpath>
<formatter type="text" toConsole="true"/>
<fileset dir="${dir.src}">
<include name="**/*.java" />
<exclude name="**/ast/*.java" />
<exclude name="**/cppast/*.java" />
</fileset>
<exclude name="net/sourceforge/pmd/dcd/**/*.java" />
</fileset>
</pmd>
</target>
@ -214,7 +215,7 @@
<delete dir="${test.outputdir}" />
<mkdir dir="${test.outputdir}/xml"/>
<junit printsummary="${test.printsummary}" showoutput="no" filtertrace="yes" haltonfailure="no" jvm="${test.jvm}" forkmode="perBatch"
failureProperty="test.failure"
failureProperty="test.failure"
>
<sysproperty key="pmd.regress" value="${test.regression}"/>
<classpath>
@ -243,8 +244,8 @@
</fileset>
<report format="frames" todir="${test.outputdir}/html" />
</junitreport>
<xslt in="${test.outputdir}/xml/TESTS-TestSuites.xml" style="etc/xslt/junit-txt-output.xsl" out="${test.outputdir}/summary.txt" />
<concat>
<xslt in="${test.outputdir}/xml/TESTS-TestSuites.xml" style="etc/xslt/junit-txt-output.xsl" out="${test.outputdir}/summary.txt" />
<concat>
<filelist dir="${test.outputdir}" files="summary.txt"/>
</concat>
</target>
@ -328,14 +329,28 @@
</junit>
</target>
<target name="jjtree" description="Generates the Java parser and AST source filesr">
<target name="alljavacc" description="Generates all JavaCC aspects within PMD" depends="javajjtree,jspjjtree,cppjavacc">
</target>
<target name="javajjtree" description="Generates the Java parser and AST source filesr">
<delete file="src/net/sourceforge/pmd/ast/Java.jj" />
<delete file="src/net/sourceforge/pmd/ast/JavaParser.java" />
<delete file="src/net/sourceforge/pmd/ast/JavaParserConstants.java" />
<delete file="src/net/sourceforge/pmd/ast/JavaParserTreeConstants.java" />
<delete file="src/net/sourceforge/pmd/ast/JavaParserTokenManager.java" />
<delete file="src/net/sourceforge/pmd/ast/Token.java" />
<delete file="src/net/sourceforge/pmd/ast/TokenMgrError.java" />
<delete file="src/net/sourceforge/pmd/ast/ParseException.java" />
<delete file="src/net/sourceforge/pmd/ast/CharStream.java" />
<delete file="src/net/sourceforge/pmd/ast/JavaCharStream.java" />
<jjtree target="etc/grammar/Java.jjt" outputdirectory="src/net/sourceforge/pmd/ast" javacchome="${javacc-home.path}" />
<javacc target="src/net/sourceforge/pmd/ast/Java.jj" outputdirectory="src/net/sourceforge/pmd/ast" javacchome="${javacc-home.path}" />
<!-- Generate ASCII w/ Unicode Escapes CharStream implementation -->
<javacc usercharstream="false" unicodeinput="false" javaunicodeescape="true" static="false" target="src/net/sourceforge/pmd/ast/Java.jj" outputdirectory="src/net/sourceforge/pmd/ast" javacchome="${javacc-home.path}" />
<replace file="src/net/sourceforge/pmd/ast/JavaCharStream.java" token="public class JavaCharStream" value="public class JavaCharStream implements CharStream" />
<!-- Ensure generated using CharStream interface -->
<javacc static="false" usercharstream="true" target="src/net/sourceforge/pmd/ast/Java.jj" outputdirectory="src/net/sourceforge/pmd/ast" javacchome="${javacc-home.path}" />
<delete file="src/net/sourceforge/pmd/ast/Java.jj" />
<replace file="src/net/sourceforge/pmd/ast/JavaParserTokenManager.java" token="throw new Error" value="throw new RuntimeException" />
<replace file="src/net/sourceforge/pmd/ast/JavaParser.java" token="throw new Error" value="throw new RuntimeException" />
@ -344,21 +359,56 @@
<replace file="src/net/sourceforge/pmd/ast/ParseException.java" token="extends Exception" value="extends RuntimeException" />
<replace file="src/net/sourceforge/pmd/ast/TokenMgrError.java" token="extends Error" value="extends RuntimeException" />
<replace file="src/net/sourceforge/pmd/ast/JavaParserVisitor.java" token="SimpleNode" value="SimpleJavaNode" />
<replace file="src/net/sourceforge/pmd/ast/Token.java">
<replacetoken><![CDATA[ default : return new Token(ofKind, image);
}
}
]]></replacetoken>
<replacevalue><![CDATA[ case JavaParserConstants.RUNSIGNEDSHIFT :
case JavaParserConstants.RSIGNEDSHIFT :
case JavaParserConstants.GT:
return new GTToken(ofKind, image);
default : return new Token(ofKind, image);
}
}
public static final class GTToken extends Token {
public int realKind = JavaParserConstants.GT;
public GTToken(int ofKind, String image) {
super(ofKind, image);
}
}
]]></replacevalue>
</replace>
</target>
<target name="jspjjtree" description="Generates the JSP parser and AST source filesr">
<delete file="src/net/sourceforge/pmd/ast/jsp/JspParser.jj" />
<delete file="src/net/sourceforge/pmd/ast/jsp/JspParser.java" />
<delete file="src/net/sourceforge/pmd/ast/jsp/JspParserConstants.java" />
<delete file="src/net/sourceforge/pmd/ast/jsp/JspParserTreeConstants.java" />
<delete file="src/net/sourceforge/pmd/ast/jsp/JspParserTokenManager.java" />
<delete file="src/net/sourceforge/pmd/jsp/ast/JspParser.jj" />
<delete file="src/net/sourceforge/pmd/jsp/ast/JspParser.java" />
<delete file="src/net/sourceforge/pmd/jsp/ast/JspParserConstants.java" />
<delete file="src/net/sourceforge/pmd/jsp/ast/JspParserTreeConstants.java" />
<delete file="src/net/sourceforge/pmd/jsp/ast/JspParserTokenManager.java" />
<delete file="src/net/sourceforge/pmd/jsp/ast/Token.java" />
<delete file="src/net/sourceforge/pmd/jsp/ast/TokenMgrError.java" />
<delete file="src/net/sourceforge/pmd/jsp/ast/ParseException.java" />
<delete file="src/net/sourceforge/pmd/jsp/ast/CharStream.java" />
<jjtree target="etc/grammar/JspParser.jjt" outputdirectory="src/net/sourceforge/pmd/jsp/ast/" javacchome="${javacc-home.path}" />
<javacc target="src/net/sourceforge/pmd/jsp/ast/JspParser.jj" outputdirectory="src/net/sourceforge/pmd/jsp/ast" javacchome="${javacc-home.path}" />
<!-- Generate Unicode w/o Unicode Escapes CharStream implementation -->
<javacc static="false" usercharstream="false" unicodeinput="true" javaunicodeescape="false" target="src/net/sourceforge/pmd/jsp/ast/JspParser.jj" outputdirectory="src/net/sourceforge/pmd/jsp/ast" javacchome="${javacc-home.path}" />
<replace file="src/net/sourceforge/pmd/jsp/ast/SimpleCharStream.java" token="public class SimpleCharStream" value="public class JspCharStream implements CharStream" />
<replace file="src/net/sourceforge/pmd/jsp/ast/SimpleCharStream.java" token="public SimpleCharStream" value="public JspCharStream" />
<move file="src/net/sourceforge/pmd/jsp/ast/SimpleCharStream.java" tofile="src/net/sourceforge/pmd/jsp/ast/JspCharStream.java"/>
<delete file="src/net/sourceforge/pmd/jsp/ast/JspParser.java" />
<!-- Ensure generated using CharStream interface -->
<javacc static="false" usercharstream="true" unicodeinput="true" javaunicodeescape="false" target="src/net/sourceforge/pmd/jsp/ast/JspParser.jj" outputdirectory="src/net/sourceforge/pmd/jsp/ast" javacchome="${javacc-home.path}" />
<delete file="src/net/sourceforge/pmd/jsp/ast/JspParser.jj" />
<replace file="src/net/sourceforge/pmd/jsp/ast/JspParserTokenManager.java" token="throw new Error" value="throw new RuntimeException" />
<replace file="src/net/sourceforge/pmd/jsp/ast/JspParser.java" token="throw new Error" value="throw new RuntimeException" />
<replace file="src/net/sourceforge/pmd/jsp/ast/JspCharStream.java" token="throw new Error" value="throw new RuntimeException" />
<replace file="src/net/sourceforge/pmd/jsp/ast/ParseException.java" token="throw new Error" value="throw new RuntimeException" />
<replace file="src/net/sourceforge/pmd/jsp/ast/ParseException.java" token="extends Exception" value="extends net.sourceforge.pmd.ast.ParseException" />
<replace file="src/net/sourceforge/pmd/jsp/ast/CharStream.java" token="public interface CharStream {" value="public interface CharStream extends net.sourceforge.pmd.ast.CharStream {" />
<replace file="src/net/sourceforge/pmd/jsp/ast/TokenMgrError.java" token="extends Error" value="extends RuntimeException" />
</target>
@ -366,25 +416,33 @@
<delete>
<fileset dir="src/net/sourceforge/pmd/cpd/cppast">
<include name="*.java" />
<exclude name="TokenMgrError.java" /> <!-- TokenMgrError customized to report filename, so don't delete it -->
</fileset>
</delete>
<javacc target="etc/grammar/cpp.jj" outputdirectory="src/net/sourceforge/pmd/cpd/cppast" javacchome="${javacc-home.path}" />
<!-- In PMD pre-5.0, CPP uses a static parser without a CharStream interface -->
<javacc static="true"
usercharstream="false"
target="etc/grammar/cpp.jj"
outputdirectory="src/net/sourceforge/pmd/cpd/cppast"
javacchome="${javacc-home.path}" />
<replace file="src/net/sourceforge/pmd/cpd/cppast/ParseException.java" token="extends Exception" value="extends RuntimeException" />
<replace file="src/net/sourceforge/pmd/cpd/cppast/TokenMgrError.java">
<replacetoken><![CDATA["Lexical error at line "]]></replacetoken>
<replacevalue><![CDATA["Lexical error in file " + CPPParserTokenManager.getFileName() + " at line "]]></replacevalue>
</replace>
</target>
<target name="clean" depends="delete,compile,copy" description="Does a complete recompile" />
<target name="dist" depends="clean,jar,weave" description="Preps things for a release" />
<target name="dist" depends="clean,jar" description="Preps things for a release" />
<target name="cpdjnlp" depends="dist" description="Uploads a new CPD JNLP thingy to the PMD web site">
<signjar jar="${dir.lib}/pmd-${version}.jar" storetype="${keystore.type}" alias="${keystore.alias}" keystore="${keystore.path}" storepass="${keystore.password}" />
<exec executable="scp" os="Linux">
<arg line=" ${dir.lib}/pmd-${version}.jar pmd.sourceforge.net:/home/groups/p/pm/pmd/htdocs" />
<arg line=" ${dir.lib}/pmd-${version}.jar ${user.name},pmd@web.sourceforge.net:/home/groups/p/pm/pmd/htdocs" />
</exec>
<echo message="Uploading cpd.jnlp" />
<exec executable="scp" os="Linux">
<arg line=" etc/cpd.jnlp pmd.sourceforge.net:/home/groups/p/pm/pmd/htdocs" />
<arg line=" etc/cpd.jnlp ${user.name},pmd@web.sourceforge.net:/home/groups/p/pm/pmd/htdocs" />
</exec>
</target>

27
pmd/bin/cpd.sh Executable file → Normal file
View File

@ -19,7 +19,13 @@ if [ -z "$1" ]; then
echo " $script <directory>"
exit 1
fi
shift
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
esac
SCRIPT_DIR=`dirname $0`
CWD="$PWD"
@ -27,6 +33,14 @@ CWD="$PWD"
cd "$SCRIPT_DIR/../lib"
LIB_DIR=`pwd -P`
# If cygwin, convert to Unix form before manipulating
if $cygwin ; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
classpath=$CLASSPATH
build_dir="$SCRIPT_DIR/../build"
@ -55,11 +69,18 @@ case "$HEAPSIZE" in
esac
case "$LANGUAGE" in
cpp|c) ;;
*) echo "Language '$LANGUAGE' unknown (try: cpp, c)"
c|cpp|cs|fortran|java|jsp|php|ruby) ;;
*) echo "Language '$LANGUAGE' unknown (try: c, cpp, fortran, java, jsp, php, ruby)"
exit 1
esac
# echo "CLASSPATH: $classpath"
java $HEAPSIZE -cp $classpath net.sourceforge.pmd.cpd.CPD --minimum-tokens $MINIMUM_TOKENS --files $DIRECTORY --language $LANGUAGE
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
classpath=`cygpath --path --windows "$classpath"`
DIRECTORY=`cygpath --windows "$DIRECTORY"`
fi
java $HEAPSIZE -cp $classpath net.sourceforge.pmd.cpd.CPD --minimum-tokens $MINIMUM_TOKENS --files $DIRECTORY --language $LANGUAGE ${@}

4
pmd/bin/cpdgui.bat Executable file → Normal file
View File

@ -1,8 +1,8 @@
@echo off
set TOPDIR=%~dp0/..
set VERSION=4.2
set VERSION=4.3
set PMDJAR=%TOPDIR%/lib/pmd-%VERSION%.jar
set JARPATH=%TOPDIR%/lib/asm-3.1.jar;%TOPDIR%/lib/jaxen-1.1.1.jar
set JARPATH=%TOPDIR%/lib/asm-3.2.jar;%TOPDIR%/lib/jaxen-1.1.1.jar
set OPTS=-Xmx512m
set MAIN_CLASS=net.sourceforge.pmd.cpd.GUI

18
pmd/bin/cpdgui.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# Shell script to launch PMD's Copy Paste Detector GUI on a
# UNIX system, based on the cpdgui.bat file used to do the
# same on MS Windows systems. This requires that the "java"
# command be in your executable PATH.
# Version number for this PMD release
VERSION=4.2.6
BINDIR=`dirname $0`
ROOTDIR=${BINDIR}/..
PMDJAR=${ROOTDIR}/lib/pmd-${VERSION}.jar
JARPATH=${TOPDIR}/lib/asm-3.2.jar:${TOPDIR}/lib/jaxen-1.1.1.jar
JVMOPTS=-Xmx512m
MAIN_CLASS=net.sourceforge.pmd.cpd.GUI
java ${JVMOPTS} -cp "${PMDJAR}:${JARPATH}" ${MAIN_CLASS} $*

View File

@ -1,17 +0,0 @@
#! /bin/sh
cygwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
esac
FILE=$1
FORMAT=$2
RULESETFILES=$3
VERSION=4.2
PMD_CLASSPATH=../lib/pmd-$VERSION.jar:../lib/jaxen-1.1.1.jar:../lib/asm-3.1.jar
if $cygwin; then
FILE=`cygpath --windows "$FILE"`
PMD_CLASSPATH=`cygpath --path --windows "$PMD_CLASSPATH"`
echo since they are comma delimited the RULESETFILES "$RULESETFILES"
echo will need an iteration loop to convert properly
fi
java -cp ${PMD_CLASSPATH} net.sourceforge.pmd.PMD $FILE $FORMAT $RULESETFILES

View File

@ -1,8 +1,8 @@
@echo off
set TOPDIR=%~dp0/..
set VERSION=4.2
set VERSION=4.3
set PMDJAR=%TOPDIR%/lib/pmd-%VERSION%.jar
set JARPATH=%TOPDIR%/lib/asm-3.1.jar;%TOPDIR%/lib/jaxen-1.1.1.jar
set JARPATH=%TOPDIR%/lib/asm-3.2.jar;%TOPDIR%/lib/jaxen-1.1.1.jar
set OPTS=
set MAIN_CLASS=net.sourceforge.pmd.util.designer.Designer

19
pmd/bin/designer.sh Executable file → Normal file
View File

@ -1,11 +1,25 @@
#!/bin/bash
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
esac
SCRIPT_DIR=`dirname $0`
CWD="$PWD"
cd "$SCRIPT_DIR/../lib"
LIB_DIR=`pwd -P`
# If cygwin, convert to Unix form before manipulating
if $cygwin ; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
classpath=$CLASSPATH
build_dir="$SCRIPT_DIR/../build"
@ -31,4 +45,9 @@ RULESETFILES="$@"
# echo "CLASSPATH: $classpath"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
classpath=`cygpath --path --windows "$classpath"`
fi
java -cp $classpath net.sourceforge.pmd.util.designer.Designer

4
pmd/bin/pmd.bat Executable file → Normal file
View File

@ -1,8 +1,8 @@
@echo off
set TOPDIR=%~dp0/..
set VERSION=4.2
set VERSION=4.3
set PMDJAR=%TOPDIR%/lib/pmd-%VERSION%.jar
set JARPATH=%TOPDIR%/lib/asm-3.1.jar;%TOPDIR%/lib/jaxen-1.1.1.jar
set JARPATH=%TOPDIR%/lib/asm-3.2.jar;%TOPDIR%/lib/jaxen-1.1.1.jar
set OPTS=
set MAIN_CLASS=net.sourceforge.pmd.PMD

21
pmd/bin/pmd.sh Executable file → Normal file
View File

@ -7,12 +7,26 @@ if [ -z "$3" ]; then
exit 1
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
esac
SCRIPT_DIR=`dirname $0`
CWD="$PWD"
cd "$SCRIPT_DIR/../lib"
LIB_DIR=`pwd -P`
# If cygwin, convert to Unix form before manipulating
if $cygwin ; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
classpath=$CLASSPATH
build_dir="$SCRIPT_DIR/../build"
@ -38,4 +52,11 @@ RULESETFILES="$@"
# echo "CLASSPATH: $classpath"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
classpath=`cygpath --path --windows "$classpath"`
FILE=`cygpath --windows "$FILE"`
fi
java -Xmx512m -cp $classpath net.sourceforge.pmd.PMD $FILE $FORMAT $RULESETFILES

2
pmd/bin/scp.bat Executable file → Normal file
View File

@ -6,7 +6,7 @@ set ANT_HOME=c:\ant
set PATH=c:\j2sdk1.4.2_04\bin;c:\ant\bin\;%PATH%
set CLASSPATH=../build/
set CLASSPATH=%CLASSPATH%;../
set CLASSPATH=%CLASSPATH%;../lib/asm-3.1.jar
set CLASSPATH=%CLASSPATH%;../lib/asm-3.2.jar
set CLASSPATH=%CLASSPATH%;../lib/jaxen-1.1.1.jar
set CLASSPATH=%CLASSPATH%;c:\javacc2.1\bin\lib\JavaCC.zip
set CLASSPATH=%CLASSPATH%;c:\ant\lib\ant.jar

2
pmd/bin/scp.sh Executable file → Normal file
View File

@ -4,5 +4,5 @@ PATH=/usr/local/java/bin/:$PATH
ANT_OPTS="-Xmx512m -Xms64m"
PATH=$MAVEN_HOME/bin:$PATH
CVSROOT=:ext:tomcopeland@cvs.sourceforge.net:/cvsroot/pmd
CLASSPATH=../build/:../lib/asm-3.1.jar:../lib/jaxen-1.1.1.jar:../lib/junit-4.4.jar:/usr/local/ant/lib/ant.jar:/usr/local/ant/lib/ant-nodeps.jar
CLASSPATH=../build/:../lib/asm-3.2.jar:../lib/jaxen-1.1.1.jar:../lib/junit-4.4.jar:/usr/local/ant/lib/ant.jar:/usr/local/ant/lib/ant-nodeps.jar
export CLASSPATH PATH CVSROOT ANT_OPTS

17
pmd/build.xml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<project name="pmd" default="jar" basedir=".">
<target name="delete"> <ant antfile="bin/build.xml" inheritAll="false" target="delete" /> </target>
<target name="jar"> <ant antfile="bin/build.xml" inheritAll="false" target="jar" /> </target>
<target name="weave"> <ant antfile="bin/build.xml" inheritAll="false" target="weave" /> </target>
<target name="pmdOnPmd"> <ant antfile="bin/build.xml" inheritAll="false" target="pmdOnPmd" /> </target>
<target name="test"> <ant antfile="bin/build.xml" inheritAll="false" target="test" /> </target>
<target name="regress"> <ant antfile="bin/build.xml" inheritAll="false" target="regress" /> </target>
<target name="test14"> <ant antfile="bin/build.xml" inheritAll="false" target="test14" /> </target>
<target name="regress14"> <ant antfile="bin/build.xml" inheritAll="false" target="regress14" /> </target>
<target name="clean"> <ant antfile="bin/build.xml" inheritAll="false" target="clean" /> </target>
<target name="dist"> <ant antfile="bin/build.xml" inheritAll="false" target="dist" /> </target>
<target name="qa"> <ant antfile="bin/build.xml" inheritAll="false" target="qa" /> </target>
</project>

55
pmd/docs.sh Executable file → Normal file
View File

@ -1,55 +1,62 @@
#!/bin/bash
restore_from_repository() {
local dir="${1}"
git status "${dir}"
local status="${?}"
if [ ${status} -eq 0 ]; then
git reset HEAD "${dir}"
git checkout "${dir}"
else
svn up "${dir}"
fi
}
option="${1}"
if [ -z $option ]; then
echo "Generating from pom, regenerating ruleset docs, and transforming"
ruby munge_rulesets.rb
maven -qb pmd:rulesets-index xdoc:generate-from-pom
maven -qb pmd:ruleset-docs
maven -qb pmd:rulesets-index xdoc:generate-from-pom
maven -qb pmd:ruleset-docs
rm -f rulesets/*.xml
svn up rulesets
maven -qb xdoc:transform
restore_from_repository rulesets
maven -qb xdoc:transform
elif [ $option = "all" ]; then
echo "Running maven site"
rm -rf target
ruby munge_rulesets.rb
maven -qb site
rm -f rulesets/*.xml
svn up rulesets
restore_from_repository rulesets
maven -qb xdoc:transform
elif [ $option = "uploadcurrent" ]; then
echo "Generating and uploading maven artifacts"
mvn -q source:jar javadoc:jar deploy
mvn -q deploy:deploy-file -Durl=scp://pmd.sourceforge.net/home/groups/p/pm/pmd/htdocs/maven2 -DrepositoryId=pmd-repo -Dfile=java14/lib/pmd14-4.2.jar -DpomFile=pmd-jdk14-pom.xml
mvn -q deploy:deploy-file -Durl=scp://shell.sourceforge.net/home/groups/p/pm/pmd/htdocs/maven2 -DrepositoryId=pmd-repo -Dfile=java14/lib/pmd14-4.3.jar -DpomFile=pmd-jdk14-pom.xml
echo "Generating xdocs and uploading"
ruby munge_rulesets.rb
maven -qb pmd:rulesets-index xdoc:generate-from-pom
maven -qb pmd:ruleset-docs
maven -qb pmd:rulesets-index xdoc:generate-from-pom
maven -qb pmd:ruleset-docs
rm -f rulesets/*.xml
svn up rulesets
maven -qb xdoc:transform
restore_from_repository rulesets
maven -qb xdoc:transform
DOCS_FILE=docs.tar.gz
cp xdocs/cpdresults.txt xdocs/cpp_cpdresults.txt target/docs/
cd target
rm -f $DOCS_FILE
tar zcf $DOCS_FILE docs/
scp $DOCS_FILE pmd.sourceforge.net:/home/groups/p/pm/pmd/htdocs/current/
cd ../
ssh pmd.sourceforge.net "cd /home/groups/p/pm/pmd/htdocs/current/ && tar -zxf docs.tar.gz && cp -R docs/* . && rm -rf docs && rm docs.tar.gz"
cd target/docs
rsync -a -e ssh * $USER,pmd@web.sourceforge.net:/home/groups/p/pm/pmd/htdocs
cd ../..
elif [ $option = "upload" ]; then
echo "Generating and uploading maven artifacts"
ssh $USER,pmd@shell.sf.net create
mvn -q source:jar javadoc:jar deploy
mvn -q deploy:deploy-file -Durl=scp://pmd.sourceforge.net/home/groups/p/pm/pmd/htdocs/maven2 -DrepositoryId=pmd-repo -Dfile=java14/lib/pmd14-4.2.jar -DpomFile=pmd-jdk14-pom.xml
echo "Uploading xdocs"
DOCS_FILE=docs.tar.gz
cp xdocs/cpdresults.txt xdocs/cpp_cpdresults.txt target/docs/
cd target
rm -f $DOCS_FILE
tar zcf $DOCS_FILE docs/
echo "Starting secure copy"
scp $DOCS_FILE pmd.sourceforge.net:/home/groups/p/pm/pmd/
cd ../
ssh pmd.sourceforge.net "cd /home/groups/p/pm/pmd/ && rm -rf xref && rm -rf apidocs && ./update_docs.sh"
cd target/docs
rsync -aRvz -e ssh * "${USER}@web.sourceforge.net:/home/project-web/pmd/htdocs"
cd ../..
fi
if [ -e velocity.log ]; then
rm velocity.log

View File

@ -1,10 +0,0 @@
Fixed in Subversion, and you can download a new pmd-4.2.jar file here:
http://infoether.com/~tom/pmd-4.2.jar
that contains that fix.
Thanks,
Tom
The PMD book - $20 - http://pmdapplied.com/

View File

@ -1,3 +1,129 @@
November 4, 2011 - 4.3:
Add support for Java 7 grammer - thanks to Dinesh Bolkensteyn and SonarSource
Add options --ignore-literals and --ignore-identifiers to the CPD command line task, thanks to Cd-Man
Fixed character reference in xml report - thanks to Seko
Add C# support for CPD - thanks to Florian Bauer
Fix small bug in Rule Designer UI
Improve TooManyMethods rule - thanks to a patch from Riku Nykanen
Improve DoNotCallSystemExit - thanks to a patch from Steven Christou
Fix false negative for UseArraysAsList when the array was passed as method parameter - thanks to Andy Throgmorton
Enhanced SuspiciousEqualsMethodName rule - thanks to Andy Throgmorton
Add a script to launch CPDGUI on Unix system - thanks to Tom Wheeler
New Rule:
Basic ruleset: DontCallThreadRun - thanks to Andy Throgmorton
Logging with Jakarta Commons ruleset: GuardDebugLogging
September 14, 2011 - 4.2.6:
Fixed bug 2920057 - False + : CloseRessource whith an external getter
Fixed bug 1808110 - Fixed performance issue on PreserveStackTrace
Fixed bug 2832322 - cpd.xml file tag path attribute should be entity-encoded
Fixed bug 2590258 - NPE with nicerhtml output
Fixed bug 2317099 - False + in SimplifyCondition
Fixed bug 2606609 - False "UnusedImports" positive in package-info.java
Fixed bug 2645268 - ClassCastException in UselessOperationOnImmutable.getDeclaration
Fixed bug 2724653 - AvoidThreadGroup reports false positives
Fixed bug 2835074 - False -: DoubleCheckedLocking with reversed null check
Fixed bug 2826119 - False +: DoubleCheckedLocking warning with volatile field
Fixed bug 2904832 - Type resolution not working for ASTType when using an inner class
Modify (and hopefully fixed) CPD algorithm thanks to a patch from Juan Jesús García de Soria.
Correct -benchmark reporting of Rule visits via the RuleChain
Fix issue with Type Resolution incorrectly handling of Classes with same name as a java.lang Class.
The JSP/JSF parser can now parse Unicode input.
The JSP/JSP parser can now handle <script>...</script> tags. The AST HtmlScript node contains the content.
Added Ecmascript as a supported language for CPD.
Improved include/exclude pattern matching performance for ends-with type patterns.
Dependencies updates: asm updated to 3.2
Android ruleset: CallSuperLast rule now also checks for finish() redefinitions
New rule:
Android: DoNotHardCodeSDCard
Controversial : AvoidLiteralsInIfCondition (patch 2591627), UseConcurrentHashMap
StrictExceptions : AvoidCatchingGenericException, AvoidLosingExceptionInformation
Naming : GenericsNaming
JSP: NoInlineScript
February 08, 2009 - 4.2.5:
Enhanced logging in the ClassTypeResolver to provide more detailed messaging.
Fixed bug 2315623 - @SuppressWarnings("PMD.UseSingleton") has no effect
Fixed bug 2230809 - False +: ClassWithOnlyPrivateConstructorsShouldBeFinal
Fixed bug 2338341 - ArrayIndexOutOfBoundsException in CPD (on Ruby)
Fixed bug 2315599 - False +: UseSingleton with class containing constructor
Fixed bug 1955852 - false positives for UnusedPrivateMethod & UnusedLocalVariable
Fixed bug 2404700 - UseSingleton should not act on enums
Fixed bug 2225474 - VariableNamingConventions does not work with nonprimitives
Fixed bug 1609038 - Xslt report generators break if path contains "java"
Fixed bug - JUnitTestsShouldIncludeAssert now detects Junit 4 Assert.assert... constructs
Fixed bug 2142986 - UselessOverridingMethod doesn't consider annotations
Fixed bug 2027626 - False + : AvoidFinalLocalVariable
New rule:
StrictExceptions : AvoidThrowingNewInstanceOfSameException
New ruleset:
android.xml: new rules specific to the Android platform
October 12, 2008 - 4.2.4:
Fixed bug 1481051 - false + UnusedNullCheckInEquals (and other false positives too)
Fixed bug 1943204 - Ant task: <ruleset> path should be relative to Ant basedir
Fixed bug 2139720 - Exception in PMD Rule Designer for inline comments in source
Fixed patch 2075906 - Add toString() to the rule UnnecessaryWrapperObjectCreation
Fixed ClassCastException on generic method in BeanMembersShouldSerialize
Fixed ClassCastException in symbol table code
August 31, 2008 - 4.2.3:
JavaCC generated artifacts updated to JavaCC 4.1d1.
Java grammar enhanced to include AnnotationMethodDeclaration as parent node of method related children of AnnotationTypeMemberDeclaration
Fixes for exclude-pattern
Updates to RuleChain to honor RuleSet exclude-pattern
Upgrading UselessOperationOnImmutable to detect more use cases, especially on String and fix false positives
Fixed bug 1988829 - Violation reported without source file name (actually a fix to ConsecutiveLiteralAppends)
Fixed bug 1989814 - false +: ConsecutiveLiteralAppends
Fixed bug 1977230 - false positive: UselessOverridingMethod
Fixed bug 1998185 - BeanMembersShouldSerialize vs @SuppressWarnings("serial")
Fixed bug 2002722 - false + in UseStringBufferForStringAppends
Fixed bug 2056318 - False positive for AvoidInstantiatingObjectsInLoops
Fixed bug 1977438 - False positive for UselessStringValueOf
Fixed bug 2050064 - False + SuspiciousOctalEscape with backslash literal
Fixed bug 1556594 - Wonky detection of NullAssignment
Optimizations and false positive fixes in PreserveStackTrace
@SuppressWarnings("all") disables all warnings
All comment types are now stored in ASTCompilationUnit, not just formal ones
Fixed false negative in UselessOverridingMethod
Fixed handling of escape characters in UseIndexOfChar and AppendCharacterWithChar
New rule:
Basic ruleset: EmptyInitializer
May 20, 2008 - 4.2.2:
Fixed false positive in UnusedImports: javadoc comments are parsed to check @see and other tags
Fixed parsing bug: constant fields in annotation classes
Bug fix: NPE in MoreThanOneLogger
UnnecessaryParentheses now checks all expressions, not just return statements
April 11, 2008 - 4.2.1:
'41' and '42' shortcuts for rulesets added
Fixed bug 1928009 - Error using migration ruleset in PMD 4.2
Fixed bug 1932242 - EmptyMethodInAbstractClassShouldBeAbstract false +
Fixed bug 1808110 - PreserveStackTrace
AvoidDuplicateLiteralRule now has 'skipAnnotations' boolean property
ruleset.dtd and ruleset_xml_schema.xsd added to jar file in rulesets directory
Update RuleSetWriter to handle non-Apache TRAX implementations, add an option to not use XML Namespaces
Added file encoding option to CPD GUI, which already existed for the command line and Ant
bin and java14/bin scripts:
retroweaver version was not correct in java14/bin scripts
support for extra languages in cpd.sh
standard unix scripts can be used with cygwin
March 25, 2008 - 4.2:
Fixed bug 1920155 - CheckResultSet: Does not pass for loop conditionals

View File

@ -13,7 +13,7 @@
<offline-allowed/>
<resources>
<j2se version="1.5+" max-heap-size="512M"/>
<jar href="pmd-4.2.jar"/>
<jar href="pmd-4.3.jar"/>
</resources>
<application-desc main-class="net.sourceforge.pmd.cpd.GUI"/>
</jnlp>

View File

@ -10,7 +10,7 @@ run version update script at the top level:
./etc/update_version.sh <version>
tasks implemented by script:
update pmd.bat, designer.bat, bgastviewer.*, cygwin-run.sh, cpd.jnlp, cpdgui.bat, build.xml to point to pmd-<version>.jar
update pmd.bat, designer.bat, bgastviewer.*, cpd.jnlp, cpdgui.bat, build.xml to point to pmd-<version>.jar
update PMD.java, xdocs/running.xml, compiling.xml, integrations.xml, installing.xml to reflect pmd-<version>
update the release date in the changelog
update release number and tag name in project.xml
@ -24,7 +24,7 @@ ensure all the new rules are listed in a rulesets/releases/<version>.xml file
ant -f bin/build.xml pmdOnPmd
ant -f bin/build.xml clean regress test
ant -f bin/build.xml clean regress
Check in everything
ant -f bin/build.xml dist regress regress14
@ -37,7 +37,8 @@ TESTS: Can you
2) run the Ant 'pmd' task and get a report
ant -f bin/build.xml pmd
run "./generate_release.sh <version>" in etc
cd into etc/ and run the release script:
$ ./release.sh
It will run:
@ -46,18 +47,12 @@ It will run:
generate the binary zip file
svn tag if "yes" is pressed
tag svn (unless -s if used)
generate the source zip file
if you see a bug and fix it, you can delete the release using:
svn delete https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_<version>
and then retag it
ncftpput upload.sourceforge.net incoming/ pmd-src-<version>.zip pmd-bin-<version>.zip
lftp -e "mput -O incoming/ pmd-src-<version>.zip pmd-bin-<version>.zip" upload.sourceforge.net
Note: if you see a bug and fix it, you can delete the release using (and the retag it):
$ svn delete https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_<version>
Go to Admin, File Releases, Add release
Paste stuff into the changelog/readme boxes
@ -67,13 +62,40 @@ Classify the file
Click File Releases, Edit Release, set previous version to 'hidden'.
upload command below will create and upload the maven artifacts to sourceforge. Login info
for 'pmd-repo' must be defined in ~/.m2/settings.xml
for 'pmd-repo' must be defined in ~/.m2/settings.xml:
---8<---8<---
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>pmd-repo</id>
<username>your-sf-login</username>
<password>your-sf-pwd</password>
</server>
</servers>
</settings>
--->8--->8---
cd ~/pmd/pmd/
update the "download" and "what's new" link in navigation.xml
update date and changelog links in project.xml (recent releases section)
./docs.sh all
./docs.sh upload
(You might need to "violently" upgrade maven 1's pmd plugins from 3.9 to the latest, by
doing that:
cp lib/pmd-4.3.jar ~/.maven/repository/pmd/jars/pmd-3.9.jar
Yes, I know, this is beyond ugly - and you'll probably go to hell just for reading this line...)
update cpd.jnlp by running:
ant -f bin/build.xml cpdjnlp
@ -83,3 +105,29 @@ Submit news to SF
Go to http://freshmeat.net/
Submit news to java.net
Do a blog entry
Getting the new PMD version into Maven Central Repository:
----------------------------------------------------------
1. Make sure you have a gpg key:
gpg --list-keys
2. Create a bundle
mvn clean source:jar javadoc:jar package gpg:sign repository:bundle-create -Dgpg.keyname=your_key -Dgpg.passphrase=your_pwd
3. The bundle is target/pmd-x.x.x-bundle.jar.
Test it: target/pmd-x.x.x.jar is the file, that is contained in the bundle.
So we can use it:
java -cp target/pmd-x.x.x.jar:lib/asm-3.2.jar:lib/javacc.jar:lib/jaxen-1.1.1.jar net.sourceforge.pmd.PMD src/net/sourceforge/pmd/PMD.java text unusedcode
This should work: "No problems found!"
4. Upload pmd-x.x.x-bundle.jar to https://oss.sonatype.org.
More info: https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+Maven+Central

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="//project/version">
VERSION:<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

View File

@ -1,3 +0,0 @@
#!/bin/bash
scp *.html tomcopeland@pmd.sf.net:/home/groups/p/pm/pmd/htdocs/fr/

View File

@ -1,151 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.9.104 (Linux)">
<META NAME="AUTHOR" CONTENT="Bekrar">
<META NAME="CREATED" CONTENT="20050816;5510000">
<META NAME="CHANGEDBY" CONTENT="Bekrar">
<META NAME="CHANGED" CONTENT="20050816;6020000">
<STYLE>
<!--
@page { size: 8.27in 11.69in; margin: 0.98in }
P { margin-bottom: 0.08in; direction: ltr; color: #000000; widows: 2; orphans: 2 }
P.western { font-family: "Arial", sans-serif; font-size: 10pt; so-language: fr-FR }
P.cjk { font-family: "Times New Roman", serif; font-size: 10pt }
P.ctl { font-family: "Times New Roman", serif; font-size: 10pt; so-language: ar-SA }
A:link { color: #0000ff }
A.western:link { font-family: "Arial", sans-serif }
-->
</STYLE>
</HEAD>
<BODY LANG="en-US" TEXT="#000000" LINK="#0000ff" DIR="LTR">
<UL>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/"><B>PMD</B></A></U></FONT></FONT><B><FONT COLOR="#000000">
</FONT></B>: cest un outil<FONT COLOR="#000000"> qui parcours le
code source Java et recherche des probl&egrave;mes potentiels. </FONT>
</P>
</UL>
<P LANG="fr-FR" CLASS="western" STYLE="margin-left: 0.25in; margin-bottom: 0in">
PMD poss&egrave;de une liste de r&egrave;gles &agrave; v&eacute;rifier,
ces r&egrave;gles sont regroup&eacute;es comme suit&nbsp;:</P>
<P LANG="fr-FR" CLASS="western" STYLE="margin-left: 0.25in; margin-bottom: 0in">
<BR>
</P>
<P LANG="fr-FR" CLASS="western" STYLE="margin-left: 0.25in; margin-bottom: 0in">
<BR>
</P>
<UL>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-top: 0.19in; margin-bottom: 0in">
<FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Finalizer_Rules">R&egrave;gles
d&eacute;di&eacute;es au Finalizers</A></U></FONT></FONT> : Ce
groupe contient les r&egrave;gles en rapport avec le codage des
&laquo;&nbsp;<B>Finalizers</B>&nbsp;&raquo;.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Unused_Code_Rules">R&egrave;gles
d&eacute;di&eacute;es au code non utilis&eacute;</A></U></FONT></FONT>
: Ce groupe contient une collection de r&egrave;gles qui ont pour
but de trouver le code non utilis&eacute;.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0.19in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Controversial_Rules">R&egrave;gles
controvers&eacute;es</A></U></FONT></FONT> : Contient les r&egrave;gles
qui ne jouissent pas dune unanimit&eacute; sur lint&eacute;r&ecirc;t
de leur application, elles sont s&eacute;par&eacute;es des autres
r&egrave;gles pour pouvoir donner &agrave; lutilisateurs de PMD
la possibilit&eacute; des les appliquer ou pas.</P>
</UL>
<P LANG="fr-FR" CLASS="western" STYLE="margin-left: 1.35in; margin-top: 0.19in; margin-bottom: 0.19in">
Parmi les r&egrave;gles contenus dans ce groupe&nbsp;:</P>
<UL>
<UL>
<UL>
<UL>
<UL>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-top: 0.19in; margin-bottom: 0in">
AtLeastOneConstructor&nbsp;: cette r&egrave;gle v&eacute;rifie
si la classe poss&egrave;de un constructeur au minimum.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0.19in">
SingularField&nbsp;: un champs de classe utilis&eacute;
uniquement par une seule m&eacute;thode peut &ecirc;tre remplac&eacute;
par une variable locale &agrave; la m&eacute;thode.</P>
</UL>
</UL>
</UL>
</UL>
</UL>
<UL>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0.19in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Optimization_Rules">R&egrave;gles
doptimisation</A></U></FONT></FONT> : Ce groupe de r&egrave;gles
&agrave; pour but dimposer les bonnes pratiques de codage qui ont
pour but doptimiser les performances du code, par exemple&nbsp;:</P>
</UL>
<UL>
<UL>
<UL>
<UL>
<UL>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in">AvoidInstantiatingObjectsInLoops&nbsp;:
D&eacute;tecte les endroits o&ugrave; il existe des
instanciation dobjets dans une boucle.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0.19in">
UseStringBufferForStringAppends&nbsp;: D&eacute;tecte les
endroit du code o&ugrave; il y a une concat&eacute;nation de
cha&icirc;nes de caract&egrave;re et conseille dutiliser des
StringBuffers pour faire cette op&eacute;ration car cest plus
rapide &agrave; lex&eacute;cution.</P>
</UL>
</UL>
</UL>
</UL>
</UL>
<UL>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Basic_Rules">R&egrave;gles
basiques</A></U></FONT></FONT>&nbsp;: Ce groupe contient un ensemble
de bonnes pratiques que chaque un se doit de respecter.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Design_Rules">R&egrave;gles
de conception</A></U></FONT></FONT>&nbsp;: Ce groupe contient un
certain nombre de r&egrave;gles qui d&eacute;tectent les zones
floues de la conception du code audit&eacute;.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Strict_Exception_Rules">R&egrave;gles
relatives aux exceptions</A></U></FONT></FONT>&nbsp;: Ce groupe
contient les r&egrave;gles relatives &agrave; la capture et au
renvoi dexceptions.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#JavaBean_Rules">R&egrave;gles
relatives aux JavaBeans</A></U></FONT></FONT> : Ce groupe contient
les r&egrave;gles qui d&eacute;tectent les JavaBeans qui ne
respectent pas les r&egrave;gles de codage de ce type de classes.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#java_lang_String_Rules">R&egrave;gles
relatives aux java.lang.String</A></U></FONT></FONT> : Ce groupe
contient les r&egrave;gles qui d&eacute;montrent les diff&eacute;rents
probl&egrave;mes qui peuvent appara&icirc;tre lors de la
manipulation des objets de type java.lang.String.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Code_Size_Rules">R&egrave;gles
relatives &agrave; la taille du code</A></U></FONT></FONT>&nbsp;: Ce
groupe contient les r&egrave;gles qui contr&ocirc;lent la taille des
diff&eacute;rentes composantes du code.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Import_Statement_Rules">R&egrave;gles
relatives au imports</A></U></FONT></FONT>&nbsp;: Ce groupe contient
les r&egrave;gles relatives &agrave; loptimisation des imports.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Clone_Implementation_Rules">R&egrave;gles
relative &agrave; lutilisation de la m&eacute;thode Clone()</A></U></FONT></FONT>&nbsp;:
Ce groupe contient les r&egrave;gles qui d&eacute;tectent les
&eacute;ventuels probl&egrave;mes qui peuvent &ecirc;tre rencontr&eacute;s
lors dune mauvaise utilisation de la m&eacute;thode <B>Clone()</B>.
</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Naming_Rules">R&egrave;gles
de nommage</A></U></FONT></FONT> : Ce groupe contient les r&egrave;gles
qui soccupent de v&eacute;rifier les diff&eacute;rentes r&egrave;gles
de nommage des composantes du code.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Java_Logging_Rules">R&egrave;gles
relatives aux logs</A></U></FONT></FONT> : Ce groupe contient les
r&egrave;gles qui r&eacute;gissent les logs de lapplication.</P>
<LI><P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0.19in"><FONT COLOR="#0000ff"><FONT FACE="Arial, sans-serif"><U><A CLASS="western" HREF="http://pmd.sourceforge.net/rules/index.html#Braces_Rules">R&egrave;gles
relatives aux accolades</A></U></FONT></FONT> : Contient un groupe
de r&egrave;gles relatives &agrave; la disposition des accolades.</P>
</UL>
<P LANG="fr-FR" CLASS="western" STYLE="margin-left: 0.25in; margin-bottom: 0in">
<BR>
</P>
<P LANG="fr-FR" CLASS="western" STYLE="margin-bottom: 0in"><BR>
</P>
</BODY>
</HTML>

View File

@ -1,100 +0,0 @@
#!/bin/bash
version=$1
pmd_top_dir=~/tmp
pmd_bin_dir=$pmd_top_dir/pmd-$version
pmd_src_dir=$pmd_top_dir/pmd-$version
pmd_tmp_dir=$pmd_top_dir/pmd-tmp
echo
echo "Rebuilding everything"
echo
cd ..
ant -f bin/build.xml dist
echo
echo "Press [enter] to generate docs"
read RESP
./docs.sh all
cd etc
echo
echo "generating binary file $pmd_top_dir/pmd-bin-$version.zip"
echo
rm -rf $pmd_bin_dir
rm -f $pmd_top_dir/pmd-bin-$version.zip
mkdir -p $pmd_bin_dir/etc
mkdir $pmd_bin_dir/bin
mkdir $pmd_bin_dir/lib
mkdir -p $pmd_bin_dir/java14/lib
mkdir $pmd_bin_dir/java14/bin
cp ../LICENSE.txt changelog.txt $pmd_bin_dir/etc
cd ../bin/
cp pmd.* cygwin-run.sh build.xml cpd.sh cpdgui.bat designer.* $pmd_bin_dir/bin
cd ../etc/
cp ../java14/lib/*.jar $pmd_bin_dir/java14/lib/
cp ../java14/bin/*.bat ../java14/bin/*.sh $pmd_bin_dir/java14/bin/
chmod 755 $pmd_bin_dir/java14/bin/*
cp ../lib/pmd-$version.jar ../lib/asm-3.1.jar ../lib/jaxen-1.1.1.jar ../lib/junit-4.4.jar $pmd_bin_dir/lib/
mkdir $pmd_bin_dir/etc/xslt
cp xslt/*.xslt xslt/*.js xslt/*.gif xslt/*.css $pmd_bin_dir/etc/xslt/
cp -R ../target/docs $pmd_bin_dir
cd $pmd_top_dir
zip -q -r pmd-bin-$version.zip pmd-$version/
cd -
echo
echo "binary package generated"
echo
release_tag=`echo $version|sed -e "s/\./_/g"`
echo
echo
echo "Type \"yes\" to tag svn repository using 'pmd_release_$release_tag'"
read RESP;
if [ "$RESP" = "yes" ]; then
echo
echo "Tagging release using"
echo "svn copy -m \"$version release tag\" https://pmd.svn.sourceforge.net/svnroot/pmd/trunk/pmd https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_$release_tag"
echo
svn copy -m "$version release tag" https://pmd.svn.sourceforge.net/svnroot/pmd/trunk/pmd https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_$release_tag
else
echo
echo "Skipping svn tag!!!"
echo
fi
echo "generating source file $pmd_top_dir/pmd-src-$version.zip"
rm -rf $pmd_src_dir
rm -f $pmd_top_dir/pmd-src-$version.zip
cd ../bin/
ant jarsrc
cd ..
svn -q export https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_$release_tag $pmd_src_dir
cp lib/pmd-src-$version.jar $pmd_src_dir/lib/
cp lib/pmd-$version.jar $pmd_src_dir/lib
cp -R target/docs $pmd_src_dir
rm -f $pmd_src_dir/etc/clover.license
cd $pmd_top_dir
zip -q -r pmd-src-$version.zip pmd-$version/
cd -
echo
echo "source package generated"
echo
echo "Use the command below to upload to sourceforge"
echo
echo "lftp -e \"mput -O incoming/ $pmd_top_dir/pmd-src-$version.zip $pmd_top_dir/pmd-bin-$version.zip\" upload.sourceforge.net"

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,15 @@
/* JSP Parser for PMD.
/* JSP Parser for PMD.
* It supports supports more-or-less well written JSP files.
* The JSP Document style is supported, except for inline DTD.
* The JSP Page style (<% ... %>) is supported.
* Java code is not parsed.
* Script code inside <script> ... </script> is not parsed.
*/
options {
USER_CHAR_STREAM = true;
NODE_USES_PARSER=true;
UNICODE_INPUT=true;
IGNORE_CASE = true;
STATIC = false;
@ -19,7 +21,7 @@ options {
PARSER_BEGIN(JspParser)
/**
* JSP Parser for PMD.
* @author Pieter Application Engineers NV/SA http://www.ae.be
* @author Pieter – Application Engineers NV/SA – http://www.ae.be
*/
package net.sourceforge.pmd.jsp.ast;
@ -78,6 +80,7 @@ PARSER_END(JspParser)
* - JspExpressionState : inside an expression <%= ... %>
* - JspDeclarationState : inside a declaration <%! ... %>
* - JspCommentState : inside a comment <%-- ... --%>
* - HtmlScriptContentState : inside an HTML script <script> ... </script>
*/
@ -263,6 +266,18 @@ PARSER_END(JspParser)
| < COMMENT_TEXT: (~[]) >
}
<HtmlScriptContentState> TOKEN :
{
<HTML_SCRIPT_CONTENT: (~[]) >
| <HTML_SCRIPT_END_TAG : "</script" | "</Script" | "</SCRIPT">
{
// We've done a custom lookahead for the closing </script> and found it.
// Put it back into the input stream, so it can be processed normally.
input_stream.backup(8);
image.setLength(image.length() - 8); // kill the "<script"
matchedToken.image = image.toString();
} : AfterTagState
}
/** ******************************************************************** */
/** ************************* JSP GRAMMAR **************************** */
@ -498,9 +513,20 @@ void Element() :
(Attribute())*
(
(<TAG_END>
{ jjtThis.setEmpty(false); }
{
jjtThis.setEmpty(false);
// Content in a <script> element needs special treatment (like a comment or CDataSection).
// Tell the TokenManager to start looking for the body of a script element. In this
// state all text will be consumed by the next token up to the closing </script> tag.
// This is a context sensitive switch for the token manager, not something one can
// express using normal JavaCC syntax. Hence the hoop jumping.
if ("script".equalsIgnoreCase(startTagName.image)) {
token_source.SwitchTo(HtmlScriptContentState);
}
}
(Content())?
(HtmlScript() | Content())?
<ENDTAG_START>
endTagName = <TAG_NAME>
@ -645,3 +671,16 @@ void DoctypeExternalId() :
{ jjtThis.setUri(quoteContent(systemLiteral.image)); }
)
}
void HtmlScript() :
{
StringBuffer content = new StringBuffer();
Token t;
}
{
(t = <HTML_SCRIPT_CONTENT> { content.append(t.image); })*
<HTML_SCRIPT_END_TAG>
{
jjtThis.setImage(content.toString().trim());
}
}

View File

@ -1,3 +0,0 @@
Please see the documentation in the docs directory or at http://pmd.sf.net/.
Using PMD? Get the book! http://pmdapplied.com/

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