A possible solution to #68

This commit is contained in:
Manindra Moharana
2014-06-06 01:30:29 +05:30
parent 62630487be
commit a21ae3bc2c
2 changed files with 36 additions and 11 deletions

View File

@@ -899,11 +899,11 @@ public class ASTGenerator {
}
// find nearest ASTNode
nearestNode = findClosestNode(lineNumber, (ASTNode) compilationUnit.types()
nearestNode = findClosestNode(lineNumber, (ASTNode) errorCheckerService.getLastCorrectCU().types()
.get(0));
if (nearestNode == null) {
// Make sure nearestNode is not NULL if couldn't find a closeset node
nearestNode = (ASTNode) compilationUnit.types().get(0);
nearestNode = (ASTNode) errorCheckerService.getLastCorrectCU().types().get(0);
}
logE(lineNumber + " Nearest ASTNode to PRED "
+ getNodeAsString(nearestNode));