From ea55ca45cdf325a461b81abedca0eed228c48856 Mon Sep 17 00:00:00 2001 From: Sven Jacob Date: Fri, 17 Nov 2006 09:08:51 +0000 Subject: [PATCH] Fixed 1597987: NPE in new DaaRule git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4809 51baf565-9d33-0410-a72c-fc3788e3496d --- .../net/sourceforge/pmd/dfa/pathfinder/DAAPathFinder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pmd/src/net/sourceforge/pmd/dfa/pathfinder/DAAPathFinder.java b/pmd/src/net/sourceforge/pmd/dfa/pathfinder/DAAPathFinder.java index 97ac6c22c7..d05003c92c 100644 --- a/pmd/src/net/sourceforge/pmd/dfa/pathfinder/DAAPathFinder.java +++ b/pmd/src/net/sourceforge/pmd/dfa/pathfinder/DAAPathFinder.java @@ -16,7 +16,7 @@ import javax.swing.tree.DefaultMutableTreeNode; */ public class DAAPathFinder { private static final int MAX_PATHS = 5000; - private static final int MAX_PATH_LENGTH = 5000; + private static final int MAX_PATH_LENGTH = 2000; private IDataFlowNode rootNode; private Executable shim; @@ -198,7 +198,9 @@ public class DAAPathFinder { return; } DefaultMutableTreeNode parent = (DefaultMutableTreeNode) last.getParent(); - parent.remove(last); + if (parent != null) { + parent.remove(last); + } last = stack.getLastLeaf(); if (last == null || last.getUserObject() == null) return;