Romain Pelisse
fddf5dd2e6
Bugfixe: 1866198 - PMD should not register global Logger
...
The modifications do not seems to cause regress issues, however, we will have to check during next release if those modifications do not cause regress in ant usage or command line usage.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5792 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-18 17:56:59 +00:00
Romain Pelisse
91fb31b5dd
Correcting the example code
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5791 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-18 17:02:56 +00:00
Romain Pelisse
ecaffa8cb8
Typo and small fix
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5790 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-18 17:01:50 +00:00
Romain Pelisse
5945599897
Correcting a small defect in RegexHelper class.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5789 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-18 16:54:28 +00:00
Romain Pelisse
e8b984df71
Switching inheritance to AbstractJavaRule.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5788 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-18 16:54:04 +00:00
Ryan Gustafson
995df9ba9d
Test case which currently throws NPE from the InsufficientStringBufferDeclaration rule. It is _not_ however causing JUnit to fail (not clear why!)
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5787 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-18 10:18:36 +00:00
Ryan Gustafson
c24e7b09d2
Add since for 3.4 to 4.2.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5786 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-18 03:24:22 +00:00
Ryan Gustafson
e2e5acaa67
Added a 'since' attribute to Rules. This is the version of PMD in which a Rule was first delivered. This can help IDE users know what rules are new to PMD (e.g. I just upgraded my IDE plugin which was using PMD a.b and and PMD is now x.y, what rules are newer than a.b?).
...
All built-in PMD rules should have a value for this (added a JUnit test to that effect). We need to go back and annotate all PMD rules with their original release version. Looks like we have easy records going back to PMD 3.3, prior to that will require a bit of research in the SVN history I imagine.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5785 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-18 02:48:14 +00:00
Ryan Gustafson
6ee7b34a0f
RuleReference will make a best effort to not considering the setting of the same value as an attempt to override. StringUtil.isSame() added to compare Strings, can pass options indicating to a) trim before compare, b) ignore internal whitespace, c) ignore case.
...
Also added some // FUTURE comments related to Rule/RuleSet cloning. This would be a nice feature to have. I'm seeing various Rule copying logic in the PMD eclipse plugin which could be reduced if PMD core supported a Rule deep copy semantic via clone().
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5784 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-18 02:06:19 +00:00
Romain Pelisse
68d8659f59
Applying patch for bug [ 1894821 ] False - for Test Class without Test Cases.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5783 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-16 10:42:56 +00:00
Romain Pelisse
310141fa71
Update on the rule, but still not working...
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5782 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-15 19:11:31 +00:00
Romain Pelisse
c17da43741
Improving the RegexHelper method (simply preventing nullpointer exception).
...
Add some javadoc, always nice to have.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5781 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-15 19:10:51 +00:00
Romain Pelisse
1ef60c2cd1
Updating changelogs with last 3 bugfixes.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5780 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-15 19:08:45 +00:00
Romain Pelisse
b4706b49fd
Fix for bug 1842505 - xml output incorrect for inner classes
...
plus some minor refactoring.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5779 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-15 19:08:03 +00:00
Romain Pelisse
4d3463c219
Fixed bug 1891399 - Check for JUnit4 test method fails
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5778 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-15 19:06:07 +00:00
Ryan Gustafson
5325eaab2f
Add support for adding Rules to a RuleSet by reference. Useful for IDE plugins, which intend to allow defining custom RuleSets using existing Rules without the current copy semantics. Essentially, this lets us more easily do programmatically what we can already do in a hand-written XML.
...
For this to work, a Rule/RuleSet being added by Reference must have a file name associated with it. This information will be associated with the RuleSet when created by the RuleSetFactory using the APIs which provide file names/resources. If a raw InputStream form is used, then the file name will need to be manually set.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5777 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-15 19:04:11 +00:00
Romain Pelisse
08f5509930
Fix for bug 1882457
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5776 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-15 19:03:30 +00:00
Romain Pelisse
37a0f03f2e
Adding a test case to assert proper behavior when user does not provide configuration for showMethodsComplexity and showClassesComplexity. Default is resolved as "true". Test doesn't fail, it seems ok.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5775 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-14 13:03:43 +00:00
Romain Pelisse
6e97f66bf9
Small upgrade to CyclomaticComplexity. By default, the rule add two kind of violation (method violation, but also a class average complexity). Some user find that troublesome and it maybe messy if an aggregated report. So i had a simple configuration to the rule. I also had a couple of unit test to ensure proper behavior of this modification.
...
Code cleaning, switching inheritance to AbstractJavaRule.
Adding proper documentation to the new rule's properties.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5774 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-14 09:08:47 +00:00
Romain Pelisse
dd4b2b9112
Small upgrade to CyclomaticComplexity. By default, the rule add two kind of violation (method violation, but also a class average complexity). Some user find that troublesome and it maybe messy if an aggregated report. So i had a simple configuration to the rule. I also had a couple of unit test to ensure proper behavior of this modification.
...
Code cleaning, switching inheritance to AbstractJavaRule.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5773 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-14 09:06:49 +00:00
Romain Pelisse
17546aaa70
code cleaning (javadoc)
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5772 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-14 08:35:44 +00:00
Romain Pelisse
d78d546f6a
Code cleaning, switching inheritance from deprecated AbstractRule to AbstractJavaRule.
...
This did not broke any test, so it seems fine.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5771 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-14 08:34:15 +00:00
Ryan Gustafson
02510413f1
Use looser regex to cleanup the XML Declaration for DTD tests, to accommodate JDK6 use of 'standalone'.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5770 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-13 05:14:12 +00:00
Xavier Le Vourch
9d5b78a6b1
Designer: selecting an AST in the result list will highlist it in the code window too
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5769 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-13 04:29:04 +00:00
Ryan Gustafson
d456a8074f
Comment out some debug System.out.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5768 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-13 04:04:23 +00:00
Ryan Gustafson
66e2c18261
Refactor MockRule to be part of PMD core, as an actual Rule implementation which does nothing is useful beyond just unit testing (e.g. in IDE plugin development).
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5767 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-13 03:57:04 +00:00
Xavier Le Vourch
02eb9575e0
bug fix: invalide test case for TooFewBranchesForASwitchStatement
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5766 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-13 03:29:33 +00:00
Xavier Le Vourch
6049be38fa
bug fix: incorrect XPath expression for TooFewBranchesForASwitchStatement
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5765 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-13 03:29:16 +00:00
Ryan Gustafson
f46b8fc0ba
RuleSetWriter class can be used to Serialize a RuleSet to XML in a standard fashion. Recommend PMD IDE plugins standardize their behavior.
...
The essence of this change is to add the RuleReference and RuleSetReference classes, which contain the details that were previously missing from the runtime representation which are available in the XML, specifically the details about usage of Rules by reference. This now means that XML <-> runtime RuleSet are interchangeable, a modification in one can be reflected in the other. PMD IDE plugins which support Rule editing can now use the core PMD classes and standard XML serialization, instead of implementing custom value
objects and serialization mechanisms.
The RuleReference class is essentially a wrapping around an existing Rule instance. It is the RuleReference which is directly contained in the RuleSet now, instead of the original Rule instance. Any code which uses instanceof checks on Rule instances will have problem when encountering a RuleReference. Thankfully this is a rare occurrence, only the RuleChain code seemed to have to be tweaked to deal with this. Even so, I wouldn't be surprised if something turns up that needs to be addressed.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5764 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-12 22:38:44 +00:00
Xavier Le Vourch
60b76a7f10
spelling
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5763 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-12 18:44:33 +00:00
Romain Pelisse
0a99ac7e21
Small upgrade to the designer : I moved SymbolTableResultPanel below the ASTPanel. I really suck with Swing so I wasn't able to give it the proper ratio ( 7/10 of the panel for ASTPanel, 3/10 seems pretty fine with me).
...
I also did some code cleaning.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5762 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-12 18:40:39 +00:00
Xavier Le Vourch
54c3441c29
code cleanup: pmdOnPmd warnings
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5761 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-12 18:27:55 +00:00
Romain Pelisse
15ff2356bd
Adding a "help to newbie" feature for the designer. I enhanced tooltip to provide access data (such as Abstract, Native...). The idea is that when i start designing pmd rules with the designer it was not always clear (for me) on which kind of node i'll be able to find such a data. So now, any special keyword on a AccessNode will appear in the tooltip.
...
I already implemented this 6 month ago but i didn't have the commit it. Since the designer class has been revised,my modifications, still on the patch tracker, became obsolete.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5760 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-12 15:50:22 +00:00
Romain Pelisse
b1fa90e85c
Removing HttpFilterCounterRule still not ready ...
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5759 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-12 09:06:55 +00:00
Xavier Le Vourch
a324c170c1
PMD Rule Designer shows position info in tooltip for AST nodes and highlights matching code for selected AST node in code window.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5758 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-12 02:30:15 +00:00
Romain Pelisse
e18e69e122
Bug fix : [ 1888967 ] False +: EmptyMethodInAbstractClassShouldBeAbstract
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5757 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 17:50:35 +00:00
Romain Pelisse
d143732355
Fixing out of dated XPath Query, bug [1874313] Documentation bugs. Thanks to Dave Cronin for the report!
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5756 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 16:44:11 +00:00
Ryan Gustafson
4bb7d51339
Standardize usage of FilenameFilter to use Filter APIs. Add File extension and Directory searching to Filter APIs.
...
This is an incremental cleanup. The real cleanup is the unify all these Language specific concepts across the entire PMD code base. Specifically, the CPD Language stuff, SourceType, SourceTypeHandler, TargetJDK, Parsers, AST nodes, and anything else I missed. That change will wait until we're ready to do a major PMD internal refactoring.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5755 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 12:07:25 +00:00
Ryan Gustafson
caae2e154e
Improvements to the Filter infrastructure.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5754 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 11:05:54 +00:00
Ryan Gustafson
402645df5b
Refactor cpd.FileFinder to pmd.util.FileFinder. Old class is now @deprecated (and unused within PMD itself).
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5753 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 09:05:02 +00:00
Ryan Gustafson
f923ddd04a
CPD Ant task will report to System.out when 'outputFile' not given.
...
Added 'cpdOnPmd' target to PMD build.xml. Yeah! More dogfood!
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5752 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 08:59:04 +00:00
Ryan Gustafson
ec6f6b0e91
CPD Ant task will report to System.out when 'outputFile' not given.
...
Added 'cpdOnPmd' target to PMD build.xml. Yeah! More dogfood!
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5751 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 08:41:09 +00:00
Ryan Gustafson
00bb128289
Oops, accidentally removed a JScrollPane for the Source Code window.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5750 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 08:06:37 +00:00
Ryan Gustafson
7b5afa03ac
PMD Rule Designer can now shows Symbol Table contents for the selected AST node.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5749 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 07:49:27 +00:00
Ryan Gustafson
b31f691012
Rules can now be written which produce violations based upon aggregate file processing (i.e. cross/multiple file violations).
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5748 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-11 01:24:10 +00:00
Romain Pelisse
7f9f3f5c9d
Addind two new rules (again out of the Lint4J rules), with proper unit testing (and both 42.xml and etc/changelog updated).
...
- AbstractClassWithoutAnyMethod
- TooFewBranchesForASwitchStatement
Also, i disabled rule and test about the HttpFilterCounter rule, that is still buggy...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5747 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-09 22:42:07 +00:00
Romain Pelisse
63e05cdcf3
As usual, i forgot this one when i commited the new rule AvoidStringBuffer as field...
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5746 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-09 21:13:27 +00:00
Romain Pelisse
9cd5044506
Refactoring to match rule naming rather than implementing class, which is Generic.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5745 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-09 17:14:18 +00:00
Romain Pelisse
4927110084
Externalising generic methods, about regex, i wrote and used for both GenericClassCounter and GenericLiteralChecker. I create a package just for it, maybe it's overkill, maybe we should rename it helper ? I don't know really know, so fell free to refactor this if you don't feel this deserves a package.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5744 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-09 17:12:02 +00:00
Romain Pelisse
b77668fa16
Swith inheritance to AbstractJavaRule, as AbstractRule is deprecated.
...
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5743 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-09 16:43:13 +00:00