fixing performance issue on PreserveStackTrace by removing use of descendant:: axis. See bug 1808110

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7011 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse
2009-12-04 14:54:59 +00:00
parent 7cce040a53
commit 632fe9705a
2 changed files with 3 additions and 2 deletions

View File

@ -405,7 +405,8 @@ Creating a unnecessary Code Ruleset and moved the following rules from Basic rul
* UselessParentheses
Basic rulesets still includes a reference to those rules.
Fixed bug 2832322 - cpd.xml file tag path attribute should be entity-encoded
Fixed bug 1808110 - Fixed performance issues on PreserveStackTrace
Fixed bug 2832322 - cpd.xml file tag path attribute should be entity-encoded
Fixed bug 2826119 - False +: DoubleCheckedLocking warning with volatile field
Fixed bug 2835074 - False -: DoubleCheckedLocking with reversed null check
Fixed bug 1932242 - EmptyMethodInAbstractClassShouldBeAbstract false +

View File

@ -123,7 +123,7 @@ public class PreserveStackTraceRule extends AbstractJavaRule {
// In case of NPE...
if ( node != null && node.getImage() != null )
{
return catchStmt.hasDescendantMatchingXPath("descendant::StatementExpression/PrimaryExpression/PrimaryPrefix/Name[@Image = '" + node.getImage() + ".initCause']");
return catchStmt.hasDescendantMatchingXPath("./Block/BlockStatement/Statement/StatementExpression/PrimaryExpression/PrimaryPrefix/Name[@Image = '" + node.getImage() + ".initCause']");
}
return false;
}