forked from phoedos/pmd
Let runtime by runtime, by golly
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3595 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -82,6 +82,7 @@ public class StatementAndBraceFinder extends JavaParserVisitorAdapter {
|
||||
}
|
||||
Structure dataFlow = (Structure) data;
|
||||
|
||||
// TODO what about throw stmts?
|
||||
if (node.jjtGetParent() instanceof ASTIfStatement) {
|
||||
dataFlow.addNewNode(node); // START IF
|
||||
dataFlow.pushOnStack(NodeType.IF_EXPR, dataFlow.getLast());
|
||||
@ -145,7 +146,6 @@ public class StatementAndBraceFinder extends JavaParserVisitorAdapter {
|
||||
super.visit(node, data);
|
||||
|
||||
if (node.jjtGetParent() instanceof ASTIfStatement) {
|
||||
|
||||
ASTIfStatement st = (ASTIfStatement) node.jjtGetParent();
|
||||
if (!st.hasElse()) {
|
||||
dataFlow.pushOnStack(NodeType.IF_LAST_STATEMENT_WITHOUT_ELSE, dataFlow.getLast());
|
||||
@ -222,8 +222,6 @@ public class StatementAndBraceFinder extends JavaParserVisitorAdapter {
|
||||
* expression node even if the loop looks like for(;;).
|
||||
* */
|
||||
private void addForExpressionNode(SimpleNode node, Structure dataFlow) {
|
||||
|
||||
try {
|
||||
ASTForStatement parent = (ASTForStatement) node.jjtGetParent();
|
||||
boolean hasExpressionChild = false;
|
||||
boolean hasForInitNode = false;
|
||||
@ -254,9 +252,5 @@ public class StatementAndBraceFinder extends JavaParserVisitorAdapter {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ClassCastException e) {
|
||||
System.err.println("Wrong use of method addForExpressionNode(..).");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user