5064 Commits

Author SHA1 Message Date
Wouter Zelle
8fe436e1a2 SingularField greatly improved to generate very few false positives (none?). Moved from controversial to design. Two options added to restore old behaviour (mostly).
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5556 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-18 15:24:48 +00:00
Xavier Le Vourch
31ed60a519 new rule UseEqualsToCompareStrings added to strings.xml
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5555 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-18 04:00:00 +00:00
Xavier Le Vourch
bb9ac4ee60 Fixed false negative in UnnecessaryCaseChange
as test case was found in the pmd code itself, rule is also added to the "dogfood"
pmdOnPmd ruleset...


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5554 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-18 01:32:25 +00:00
Xavier Le Vourch
b4f97dcd99 code cleanup: useless test for null removed
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5553 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-18 00:23:40 +00:00
Xavier Le Vourch
503168639d code cleanup: use valueOf for primitive types
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5552 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-18 00:22:57 +00:00
Xavier Le Vourch
af6d712936 code cleanup: invalid string comparison
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5551 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-18 00:22:04 +00:00
Xavier Le Vourch
63527110d8 code cleanup
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5550 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-18 00:21:41 +00:00
Wouter Zelle
1b3eb203df SingularField no longer complains on lock objects
Small performance improvement (improvement not measured)

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5549 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-17 13:26:28 +00:00
Romain Pelisse
32ef5cc2a8 Correction of a failing test case for RubyTokenizer.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5548 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-17 13:10:50 +00:00
Romain Pelisse
50ab6d0dc5 Adding test case to reproduce bugs 1415525 and 1811506.
I'm still working on both bugs, so for the moment those test case fail.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5547 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-17 13:10:24 +00:00
Wouter Zelle
ec2f9be6ed Added wontfix testcase
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5546 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-17 12:41:33 +00:00
Wouter Zelle
8e77381155 generics
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5545 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-17 11:15:02 +00:00
Wouter Zelle
3becab3dd5 985989, ConstructorCallsOverridableMethodRule now also checks (inner) static classes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5544 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-16 14:10:14 +00:00
Xavier Le Vourch
44ed1ac6aa TRJunitStaticSuite removed from scratchpad.xml, JUnitStaticSuite exists
in junit.xml and also uses type resolution


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5543 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-16 05:07:52 +00:00
Xavier Le Vourch
86d34ba8e4 Jaxen test string updated to get same exception as on jdk
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5542 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-16 00:23:59 +00:00
Xavier Le Vourch
93c45bc95e Commented out Jaxen exception test case, Bug 1814219 was filed on sourceforge
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5541 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-16 00:11:24 +00:00
Xavier Le Vourch
561f578817 optimization of xpath rule: on jdk benchmark, rules went from around 270s to 35s
(overall benchmark speed on all rules was cut in half by this change)


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5540 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-15 17:01:21 +00:00
Xavier Le Vourch
af3cbdb40f xpath optimization: benchmark went from 43s to 0.8s on jdk source tree
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5539 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-15 16:54:53 +00:00
Xavier Le Vourch
e19382e0c0 new 4.1 rules are listed in releases/41.xml
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5538 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-15 16:52:00 +00:00
Wouter Zelle
0cb00e9b98 674394, now also for the implicit java.lang.* import
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5537 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-15 14:53:03 +00:00
Romain Pelisse
def1a00bb6 Correction most of the bug on the new rules i introduce.
I also remove some modification i shall not have commited.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5536 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-15 14:41:14 +00:00
Wouter Zelle
4115407080 674394, disambiguation import should be allowed
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5535 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-15 14:20:26 +00:00
Wouter Zelle
1546499726 generics
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5534 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-15 12:38:13 +00:00
Wouter Zelle
0790153263 Add false positive that needs to be fixed using class resolution
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5533 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-15 12:00:29 +00:00
Romain Pelisse
be13fce11d Forget to translate some french comment into proper english
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5532 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-13 16:22:03 +00:00
Xavier Le Vourch
3f9a280751 test cases for new rules were not inserted in test suite
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5531 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-12 18:10:17 +00:00
Xavier Le Vourch
3c0331c4b2 dtd fixes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5530 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-12 17:48:49 +00:00
Xavier Le Vourch
9d4cd2d00c Typo + upper case fixes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5529 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-12 17:36:07 +00:00
Xavier Le Vourch
cda82527ab flushing output once a file report has been processed, smoother text output
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5528 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-12 17:32:59 +00:00
Xavier Le Vourch
499ea5a587 EmptyMethodInAbstractClassShouldBeAbstract changes:
xpath changes: test for abstract class before testing methods
    (rule was the worst performer in benchmark)
    and nested classes should work too

  rule wasn't added to test suite
 
  extra test cases for nested classes


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5527 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-12 17:24:33 +00:00
Romain Pelisse
26189396d6 Adding a new jdbc rule 'CheckResultSet', plus the appropriate test file.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5526 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-12 12:39:34 +00:00
Xavier Le Vourch
b29132b403 Document Jaxen exception parsing Unicode chars
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5525 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-11 19:35:24 +00:00
Xavier Le Vourch
39cda2775a CloseResource changes:
bug fix: null "closer" property exception

	com.renault.dao package test shouldn't be there...

	test case was using "closeTargets" not "closer"



git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5524 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-11 18:02:18 +00:00
Xavier Le Vourch
93aea5ac1a bug fix: junit tests failed for enum and annotations
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5523 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-11 17:27:04 +00:00
Ryan Gustafson
40d6b48a21 Add test cases for 'null' and non-String literals.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5522 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-11 17:21:52 +00:00
Xavier Le Vourch
063874db24 bug fix: image can be null for 'null' literal
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5521 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-11 08:19:41 +00:00
Wouter Zelle
fc6c0861fc typo
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5520 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-11 06:41:52 +00:00
Xavier Le Vourch
6e80aaeb01 javadoc: String.size() doesn't exist -> String.length()
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5519 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-11 05:40:47 +00:00
Ryan Gustafson
f2f4bc88a5 Correct regex to handle 1 to 3 digit base 10 octets.
Remove incorrect usage of static on Pattern instance.
Fix init() to be called when rule is executed.  In Constructor the Rule parameters are not available yet.
Removed isPatternOk(), replaced with init() validation.
Renamed isAMatch() to isMatch().
Comment grammar fixes.
FYI, I had to remove the @Ignore from my local DynamicRuleTest to get the XML test cases to run in Eclipse!

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5518 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-10 23:26:48 +00:00
Xavier Le Vourch
c507682e7c code cleanup: useless test for "".equals() removed as string length is not 0
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5517 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-10 22:18:20 +00:00
Romain Pelisse
deba4746a0 Corrected GenericLiteral to match java rules naming convention.
Add some javadoc and proper licence
Move pattern compilation to init() 

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5516 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-10 20:48:51 +00:00
Romain Pelisse
d7a24c9409 I've adapted the HardCodedIP rule to be more generic. Now you can check match the contains of any literal, using a regex, with the GenericLiteralChecker.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5515 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-10 20:31:23 +00:00
Romain Pelisse
3bfa0613af I've adapted the HardCodedIP rule to be more generic. Now you can check match the contains of any literal, using a regex, with the GenericLiteralChecker.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5514 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-10 20:27:18 +00:00
Romain Pelisse
f075381d54 Fixed a small typo problem in the ant-task usage page.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5513 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-10 20:25:01 +00:00
Wouter Zelle
b267e3e9a9 Fixed bug 631681 - fixed false positive in UnusedPrivateField when field is accessed by outer class
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5512 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-10 10:07:54 +00:00
Romain Pelisse
57c700d1f4 Adding an other new AvoidHardCodedIP
( basicly look for string which contains a IP pattern such as '127.0.0.1').
This kind of naive usage may become a real problem when you actually deploy 
the application.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5511 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-09 22:46:03 +00:00
Romain Pelisse
115365cd08 Adding a bunch of new rules (see changelog), with the proper unit-testing.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5510 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-09 00:53:44 +00:00
Wouter Zelle
31dc0c4ea8 Added false positive test that should be fixed by type resolution one day
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5509 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-08 08:41:26 +00:00
Xavier Le Vourch
3aac6046b4 retroweaver updated to 2.0.1 version
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5508 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-05 18:18:09 +00:00
Romain Pelisse
665b70d0b2 Bugfixing for [ 1807370 ] False +: new Throwable().printStackTrace()
- the fix itself
- a new test case

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5507 51baf565-9d33-0410-a72c-fc3788e3496d
2007-10-04 14:39:08 +00:00