Community
Participate
Working Groups
Version: 3.2.0 Build id: I20060216-2000 Given: if (i != 0 //I don't like 0 && i != 10) System.out.println(i); 1. Select: (i != 0 //I don't like 0 && i != 10) 2. Ctrl-1 3. Add paranoiac paranthesis Result: if ((i != 0 //I don't like 0) && (i != 10)) System.out.println(i); Expected: if ((i != 0) //I don't like 0 && (i != 10)) System.out.println(i); (the ')' is inserted at end of comment) Looks like a bug in AST rewrite. The code to add parenthesis is rather simple: ParenthesizedExpression parenthesizedExpression= ast.newParenthesizedExpression(); parenthesizedExpression.setExpression( (Expression) rewrite.createCopyTarget(expression)); rewrite.replace(expression, parenthesizedExpression, group);
See also Bug 128818 which may be a dup?
*** This bug has been marked as a duplicate of 95839 ***
reopen. fix for bug 95839 did not cover this bug releated to copy.
*** Bug 149433 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of bug 143026 ***
Verified for 3.3 RC1 using I20070515-0010