Skip to content

Commit

Permalink
Extra parenthesis during if-statements
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Apr 8, 2024
1 parent 4ddf41e commit 6a6ecf3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,12 @@ private IfStatement convertIfStatement(JCIf javac) {
IfStatement res = this.ast.newIfStatement();
commonSettings(res, javac);
if (javac.getCondition() != null) {
res.setExpression(convertExpression(javac.getCondition()));
JCExpression expr = javac.getCondition();
if( expr instanceof JCParens jpc) {
res.setExpression(convertExpression(jpc.getExpression()));
} else {
res.setExpression(convertExpression(expr));
}
}
if (javac.getThenStatement() != null) {
res.setThenStatement(convertStatement(javac.getThenStatement(), res));
Expand Down

0 comments on commit 6a6ecf3

Please sign in to comment.