diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index f3799ae254..5412ed73ab 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -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 diff --git a/pmd/src/net/sourceforge/pmd/rules/design/PreserveStackTrace.java b/pmd/src/net/sourceforge/pmd/rules/design/PreserveStackTrace.java index 9c38432c91..36d19e6177 100644 --- a/pmd/src/net/sourceforge/pmd/rules/design/PreserveStackTrace.java +++ b/pmd/src/net/sourceforge/pmd/rules/design/PreserveStackTrace.java @@ -128,7 +128,7 @@ public class PreserveStackTrace extends AbstractJavaRule { // In case of NPE... if ( node != null && node.getImage() != null ) { - List nodes = catchStmt.findChildNodesWithXPath("descendant::StatementExpression/PrimaryExpression/PrimaryPrefix/Name[@Image = '" + node.getImage() + ".initCause']"); + List nodes = catchStmt.findChildNodesWithXPath("./Block/BlockStatement/Statement/StatementExpression/PrimaryExpression/PrimaryPrefix/Name[@Image = '" + node.getImage() + ".initCause']"); if ( nodes != null && nodes.size() > 0 ) { return true;