Closed tt-kuma closed 4 years ago
FLの実験中に発生. 題材中に条件式(optionalConditionExpression)が空のfor文があるとNullPointerExceptionで落ちる. 以下のような題材で再現できる.
optionalConditionExpression
NullPointerException
package example; public class ExampleFor { public int method() { for (int i = 0; ; i++) { if(i == 10) { break; } } return i; } }
StatementAndConditionVisitorの以下の箇所が原因だと考えられる.
StatementAndConditionVisitor
@Override public void endVisit(final ForStatement node) { consumeElement(node.getExpression()); // Blockよりも後に入れるためにendVisitで行う super.endVisit(node); }
条件式が空の場合node.getExpression()はnullになりconsumeElement()内でNullPointerExceptionが発生.
node.getExpression()
consumeElement()
FLの実験中に発生. 題材中に条件式(
optionalConditionExpression
)が空のfor文があるとNullPointerException
で落ちる. 以下のような題材で再現できる.StatementAndConditionVisitor
の以下の箇所が原因だと考えられる.条件式が空の場合
node.getExpression()
はnullになりconsumeElement()
内でNullPointerException
が発生.