Issue #3681: fixed NPE in RightCurly when do has no curlies
This commit is contained in:
parent
54058853b9
commit
2c81de1bb0
|
|
@ -370,7 +370,9 @@ public class RightCurlyCheck extends AbstractCheck {
|
|||
case TokenTypes.LITERAL_DO:
|
||||
nextToken = ast.findFirstToken(TokenTypes.DO_WHILE);
|
||||
lcurly = ast.findFirstToken(TokenTypes.SLIST);
|
||||
rcurly = lcurly.getLastChild();
|
||||
if (lcurly != null) {
|
||||
rcurly = lcurly.getLastChild();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// ATTENTION! We have default here, but we expect case TokenTypes.METHOD_DEF,
|
||||
|
|
|
|||
|
|
@ -90,5 +90,9 @@ public class InputRightCurlyDoWhile {
|
|||
public void foo9() {
|
||||
do {} while (true);
|
||||
}
|
||||
|
||||
public void foo10() {
|
||||
do ; while (true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue