5515 Commits

Author SHA1 Message Date
Xavier Le Vourch
39901cacec etc/updating_rulesets.sh modified to exclude rulesets referencing other rulesets
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5876 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-07 20:46:48 +00:00
Xavier Le Vourch
9e077e2c12 maven complains about missing </p>
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5875 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-07 19:03:29 +00:00
Xavier Le Vourch
5f8bf04a34 version number displayed in AST viewer
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5874 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-07 01:59:30 +00:00
Xavier Le Vourch
9c4ef51364 retroweaver updated to version 2.0.5
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5873 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-07 00:36:25 +00:00
Xavier Le Vourch
569fd197fc version number displayed in cpd and designer guis
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5872 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-07 00:25:50 +00:00
Xavier Le Vourch
18ee21de3c version update to 4.2rc1
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5871 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-07 00:25:22 +00:00
Xavier Le Vourch
dfd7a984b0 AST cleanup: class ASTEnumElement removed as it's not used
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5870 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-06 03:28:20 +00:00
Ryan Gustafson
a11337cab4 Handle scenario where missing dependent classes causes PMD to explode.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5869 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-06 02:35:36 +00:00
Ryan Gustafson
7b7f854635 Add tests cases and support for operators and expressions.
ASTName is now carrying over the type from it's Declaration when possible.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5868 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-06 02:09:35 +00:00
Ryan Gustafson
065423d619 Add tests cases and support for unary and binary numeric promotion.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5867 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-06 00:15:04 +00:00
Ryan Gustafson
6aa4be951a Added more test cases for Type Resolution. Change so that test files are available both as .java and .class, this is really the only way to properly test Type Resolution.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5866 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 22:56:26 +00:00
Ryan Gustafson
4e78fbaba6 More TypeNodes, and fixes on ClassTypeResolver.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5865 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 22:53:29 +00:00
Xavier Le Vourch
541267c146 regeneration of Java Parser classes to reflect changes in grammar file.
using cvs version of JavaCC from March 05 2008


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5864 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 18:25:11 +00:00
Ryan Gustafson
8df01bae99 Update TODO comments for array treatment on allocation expressions (turns out to be more complex than I first thought).
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5863 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 09:00:44 +00:00
Ryan Gustafson
65c6faf511 Update grammar to indicate basic literal type on the ASTLiteral class. Type Resolution can use this to determine the proper Java type (int, long, float, double, char, String) as needed.
This will break the build as I don't have the magic version of JavaCC used to generate the parser.  It's not JavaCC 4.0.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5862 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 08:40:13 +00:00
Ryan Gustafson
c05badf566 Comment and bug fix.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5861 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 06:38:52 +00:00
Ryan Gustafson
40a46d11a9 Vast expansion of Type Resolution scope on the AST to cover every possible (AFAIK) node which can meaningfully have a Type. Type information is being rolled up the AST to the top most nodes, based on expression and operator rules defined in the JLS.
The ternary operator, and PrimaryExpressions are not yet done.  This feature will not work very well until PrimaryExpression are handled, as this node appears very often.  A failure at this level could stop the progress of the rollup, seriously limiting utility.

Also, some Parser changes are needed to (1) annotate literals with their type, and (2) know the dimensionality of array types.

Yeah, need to write a boatload of test cases too. :)


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5860 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 06:36:33 +00:00
Ryan Gustafson
8253ad505c Change a bunch of the AST nodes to also be TypeNodes.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5859 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 06:22:49 +00:00
Xavier Le Vourch
765742556d local scope only for block statements, based on comments from Ryan
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5858 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 02:28:57 +00:00
Ryan Gustafson
2c5babd8c6 Reverse genericization of java.lang.Class due to incompatible changes w.r.t Java 5 and Java 6.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5857 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-05 01:58:00 +00:00
Ryan Gustafson
08bd834cd3 Refactor to add SimpleJavaTypeNode based class for TypeNode interface. Extracted an AccessNode interface and added base classes SimpleJavaAccessNode and SimpleJavaAccessTypeNode (will need this later one as I expand scope of Type Resolution).
Note: For now please do not change usages of AccessNode to be usages of SimpleJavaAccessNode so that class hierarchy compatibility is preserved.  We can do that post 4.2.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5856 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-04 22:22:16 +00:00
Ryan Gustafson
57d35ddb88 Add info about RuleChain for performance. Also, pre-commit instructions.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5855 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-04 21:49:01 +00:00
Xavier Le Vourch
7e71181ebe bug fix: local variables in constructors were created in the method scope
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5854 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-04 18:55:00 +00:00
Romain Pelisse
f3025e1624 Reducing rule priority. We can't say that call explicitly GC is going to "break" the application.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5853 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-04 11:42:02 +00:00
Romain Pelisse
49e28b8601 Adding a small documentation page about all the QA stuff and piece of knowledge, i have learn since i join the project.
I think this will be helpful (unless we decide to force every new commiter to read ALL the commit message since PM 1.0 ! :) )

Note: this page is far from being finished, so i didn't include it in the website navigation.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5852 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-04 11:07:19 +00:00
Xavier Le Vourch
6dc2a50686 optimization: DoNotCallGarbageCollectionExplicitly rewritten. The new implementation
only takes 40% of the time.

Note: when writing a new rule, using command line option "-benchmark" on a few rules
can give an indication on how the rule compares to others. To get the full picture,
use the rulesets/internal/all-java.xml ruleset with "-benchmark".

This rule was the slowest when running on the jdk source tree: it took 69s to complete.
The new version only takes 27s.


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5851 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-03 23:34:11 +00:00
Xavier Le Vourch
1a6dffa690 bug fixes for AbstractClassWithoutAnyMethod:
test cases were not included correctly

abstract class with constructors should not raise a warning

incorrect test case


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5850 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-03 22:06:31 +00:00
Xavier Le Vourch
84235d0a29 another regression problem with AvoidReassigningParameters: incorrect warnings for local variables in constructors
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5849 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-03 21:14:22 +00:00
Xavier Le Vourch
3ff43ca4c8 regression in AvoidReassigningParameters: starting with 'this' or 'super' in not enough,
a '.' needs to be there too...

(found by regression test on jdk source)


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5848 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-03 20:13:17 +00:00
Romain Pelisse
0cb98fae1d Bug fix for 1902351 - AvoidReassigningParameters not identify parent field
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5847 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-03 13:36:05 +00:00
Xavier Le Vourch
17eb8a8ce8 temp file shouldn't have been included in last commit
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5846 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-02 19:59:37 +00:00
Xavier Le Vourch
25eb7d5bd3 new test case showing xml parsing problem that occurs only on Windows with the jdk 1.4 version. Test is not part of regression suite, use 'test14' target to run it
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5845 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-02 19:58:32 +00:00
Xavier Le Vourch
dd9ce02db8 refactoring: static method TestDescriptor.inRegressionTestMode() gets the 'pmd.regress' property
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5844 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-02 19:13:57 +00:00
Xavier Le Vourch
55a729a3f0 message parameter wasn't used in assertEqualsRuleSet()
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5843 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-02 18:40:22 +00:00
Xavier Le Vourch
3451f93a35 weird parsing problem only occuring for regress14 on Windows
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5842 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-02 04:45:23 +00:00
Xavier Le Vourch
3f93d2a5b6 version number moved: PMD <version> API
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5841 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-01 21:52:53 +00:00
Xavier Le Vourch
71aa17dcdd code cleanup: javadoc warnings fixed
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5840 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-01 21:45:10 +00:00
Xavier Le Vourch
4df4c24f6d new target "qa" to run most of the tests (used by continuous integration process)
javadoc tweaks: @todo ignored, ant task path specified, version displayed on main page


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5839 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-01 21:44:28 +00:00
Ryan Gustafson
ebd446d765 Remove dependency on JUnit from this Rule so it does not blow up if JUnit is not in the classpath.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5838 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-01 20:16:09 +00:00
Romain Pelisse
5ef2bbb6bc Fixed bug 1808158 - Constructor args could also be final
Modified AvoidReassigningParameter to also check constructor arguments for reassignement
Added test case for each.

Also modifier inheritance to AstractJavaRule, and added some @Override...


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5837 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-01 18:55:58 +00:00
Xavier Le Vourch
dc600b9b1b bug fix for qualified names for inner classes: name and enclosing class were inverted
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5836 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-01 04:47:21 +00:00
Xavier Le Vourch
810a6d5d07 bug fixes in SimplifyBooleanReturns:
NPE during parsing

only methods returning booleans should be checked

test case was incorrect (not a boolean method)


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5835 51baf565-9d33-0410-a72c-fc3788e3496d
2008-03-01 03:43:55 +00:00
Xavier Le Vourch
8c52e3ce5a SimplifyBooleanReturns rule should not complain as return type is void, not boolean
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5834 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-29 22:40:31 +00:00
Xavier Le Vourch
c1e8dcd5d0 SimplifyBooleanReturns test case should fail
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5833 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-29 22:11:39 +00:00
Romain Pelisse
a800b0dcd7 Committing bugfixes on SimplifyBooleanReturns to correct the NPE issue that Ryan pointed out.
Note that the commited patch also had new test case

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5832 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-29 17:02:43 +00:00
Romain Pelisse
dea79a1e39 Some "french" fixes in the messages.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5831 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-29 10:11:51 +00:00
Ryan Gustafson
4f89fdf8e6 Remove Workspace Preference DFA option, use DataflowAnomalyAnalysis rule instead
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5830 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 21:07:12 +00:00
Ryan Gustafson
5a9b99b353 Remove Workspace Preference DFA option, use DataflowAnomalyAnalysis rule instead
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5829 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 21:06:57 +00:00
Ryan Gustafson
103f965181 Remove Workspace Preference DFA option, use DataflowAnomalyAnalysis rule instead
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5828 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 21:06:50 +00:00
Ryan Gustafson
21d99c90af Allow enabling/disabling of use of Project Build Path as a Workspace PMD Preference.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5827 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 20:49:30 +00:00