5515 Commits

Author SHA1 Message Date
Ryan Gustafson
3aa436aad2 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@5826 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 20:49:20 +00:00
Ryan Gustafson
d14bed6bcb 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@5825 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 20:49:11 +00:00
Ryan Gustafson
c5af5fb7ce Allow the ClassLoader used by PMD for Type Resolution to be specified.
Forgot to handle PMDRunnable case, which is a subclass of PMD.  ClassLoader is now passed, along with the existing instance specific values (e.g. excludeMarker, sourceType).

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5824 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 20:17:02 +00:00
Ryan Gustafson
2d33b4d457 Add test case which causes current rule implementation to explode.
Corrected the test case. It wasn't legitimate Java code.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5823 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 18:34:35 +00:00
Ryan Gustafson
f169b96678 Add JavaProjectClassLoader which serves as a ClassLoader for an IJavaProject. Pass this ClassLoader to the PMD instance.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5822 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 09:56:35 +00:00
Ryan Gustafson
f02e2f8cdc Add JavaProjectClassLoader which serves as a ClassLoader for an IJavaProject. Pass this ClassLoader to the PMD instance.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5821 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 09:56:19 +00:00
Ryan Gustafson
8564544d8f Oops, didn't intend the primitives to be instance data (abandoned that approach).
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5820 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 09:40:25 +00:00
Ryan Gustafson
00249eb78d Allow the ClassLoader used by PMD for Type Resolution to be specified. This ClassLoader can be distinctly different than the ClassLoader used to load PMD itself.
IDE plugins can create ClassLoaders representing the "project" settings in the IDE, providing PMD with that ClassLoader, such that PMD can truly see the classes being represented in the IDE.  In the specific case of Eclipse, the IDE plugin runs in a ClassLoader which does not contain the details of the "project" settings, which means without this feature PMD would never be able to do proper Type Resolution.

I've not had a chance to benchmark this change.  I expect there to be some performance changes given that 'static' reference to the PMDASMClassLoader is no longer used.  Further tuning may need to be done.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5819 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 09:34:24 +00:00
Ryan Gustafson
9fe5813354 Fix 1903578 - Ensure plugin XML element ids are unique with the document.
Gah, guess those IDs are used in the code.  Reverted them to the minimum changes needed to fix the message from Eclipse.  I checked to ensure the changed IDs are not referenced in the code.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5818 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 04:46:07 +00:00
Ryan Gustafson
8feb0e047c Add test case which causes current rule implementation to explode.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5817 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 04:28:39 +00:00
Ryan Gustafson
ac62ff53e5 Fix 1903578 - Ensure plugin XML element ids are unique with the document.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5816 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 02:19:22 +00:00
Ryan Gustafson
e4c2307bee Fix 1903578 - Ensure plugin XML element ids are unique with the document.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5815 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-28 02:19:08 +00:00
Ryan Gustafson
d0b4574c25 Changes to Workspace exclude/include patterns are now reflected on the Projects.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5814 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 23:17:41 +00:00
Ryan Gustafson
7ec60e57e3 Changes to Workspace exclude/include patterns are now reflected on the Projects.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5813 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 23:17:03 +00:00
Ryan Gustafson
a54b05b00a Changes to Workspace exclude/include patterns are now reflected on the Projects.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5812 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 23:16:41 +00:00
Ryan Gustafson
63bbc45c1d Changes to Workspace exclude/include patterns are now reflected on the Projects.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5811 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 23:16:24 +00:00
Ryan Gustafson
d98eb82208 Allow setting of entire list of exclude/include patterns on a RuleSet.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5810 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 21:47:26 +00:00
Ryan Gustafson
e99bde6f5f Message updates.
Last commit in the series.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5809 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 20:59:00 +00:00
Ryan Gustafson
34a7478ccb Update plugin version numbers in prep for next release.
Whole lotta UI updates.  See CHANGELOG.txt from pmd-eclipse project for full details.

This is Part 5 of a large series of commits.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5808 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 20:55:42 +00:00
Ryan Gustafson
787e30a954 Update plugin version numbers in prep for next release.
Use new standard PMD core ruleset serialization.
Provide java.io.File on RuleContext to support new PMD exclude/include mechanism.
Error type PMD Violations now show in Problems View for manual PMD invocations.
Use Rule references when building RuleSets, instead of Rule copies.
Add support for tracking RuleSet file on project properties.

Part 4 of a large series of commits.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5807 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 20:45:15 +00:00
Ryan Gustafson
303546c0cd Update plugin version numbers in prep for next release. Add trunk version of PMD, update once PMD 4.2 is out.
This is Part 3 of a large series of commits.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5806 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 19:53:47 +00:00
Ryan Gustafson
32929d250c Update plugin version numbers in prep for next release.
This is Part 2 of a large series of commits.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5805 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 19:49:46 +00:00
Ryan Gustafson
21c1d62926 Update plugin version numbers in prep for next release. Added TODO.txt initialized with thoughts on various things to look at in the future. Change log and release notes updated.
This is Part 1 of a large series of commits.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5804 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 19:49:00 +00:00
Ryan Gustafson
201f6b518c More detailed performance metric logging.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5803 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-27 19:41:09 +00:00
Romain Pelisse
8cfec413d6 Updating link to maven plugin homepage.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5802 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-25 09:44:45 +00:00
Ryan Gustafson
3a1878eef3 Add -nocloseonexit option to support not killing JVM when closing designer window. This will allow IDE plugins to launch the designer directly via Designer.main() instead of Runtime.exec().
Clean up split planes some.  Not perfect on the splits for the AST/Symbol table panel, either we're doing it wrong, or Swing is buggy (imagine that!).  I preferred my original 3 horizontal panels over this layout.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5801 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-22 21:31:35 +00:00
Ryan Gustafson
c6937c6e23 Fixed name/description (forgot I renamed to all-java after I remove the jsp rules).
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5800 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-22 19:43:27 +00:00
Ryan Gustafson
2648bf6126 Added internal ruleset all-java.xml, useful for developer testing.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5799 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-22 19:24:47 +00:00
Xavier Le Vourch
18fc950807 missing since tags added, testAllPMDBuiltInRulesNeedSince test case now works
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5798 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-22 01:28:17 +00:00
Romain Pelisse
423d6df9e3 Corrected a defect, plus "pmdOnPmd" (added some suppresswarning when defect did not appear to be fixable)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5797 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-19 14:19:34 +00:00
Ryan Gustafson
65e6f4eec6 Add more 'since' attributes to Rules. Almost everyone in the JUnit test is covered. If you can figure out the remaining ones, please do so! I've mined the changelog.txt as much as I can.
Add some // FUTURE commments.

Missed a 42.xml entry for new Rule.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5796 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-19 10:55:13 +00:00
Ryan Gustafson
0a300e8860 Fix problem with appending null and boolean literals in InsufficientStringBufferDeclaration.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5795 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-19 08:32:11 +00:00
Ryan Gustafson
5469d135f7 Implement AvoidMultipleUnaryOperators as a Java rule to catch scenarios with arbitrary parentheses nesting.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5794 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-19 08:04:07 +00:00
Ryan Gustafson
0af168412b Add AvoidMultipleUnaryOperators rule.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5793 51baf565-9d33-0410-a72c-fc3788e3496d
2008-02-19 06:08:54 +00:00
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