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

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7010 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse 2009-12-04 14:37:46 +00:00
parent 59eaa27c59
commit f67056e7d7
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
???? - 4.2.6:
Fixed bug 1808110 - Fixed performance issue on PreserveStackTrace
Fixed bug 2832322 - cpd.xml file tag path attribute should be entity-encoded
Fixed bug 2590258 - NPE with nicerhtml output
Fixed bug 2317099 - False + in SimplifyCondition

View File

@ -128,7 +128,7 @@ public class PreserveStackTrace extends AbstractJavaRule {
// In case of NPE...
if ( node != null && node.getImage() != null )
{
List <Node> nodes = catchStmt.findChildNodesWithXPath("descendant::StatementExpression/PrimaryExpression/PrimaryPrefix/Name[@Image = '" + node.getImage() + ".initCause']");
List <Node> nodes = catchStmt.findChildNodesWithXPath("./Block/BlockStatement/Statement/StatementExpression/PrimaryExpression/PrimaryPrefix/Name[@Image = '" + node.getImage() + ".initCause']");
if ( nodes != null && nodes.size() > 0 )
{
return true;