Community
Participate
Working Groups
Build Identifier: 20100218-1602 Performing the "exchange left and right operands for infix expression" refactoring can strip parentheses around one operand, changing the meaning of the expression unexpectedly. Marking as normal rather than minor because a user might trust that the refactoring preserves semantics, especially if they're unsure of the evaluation order/rules (I had to make a testcase to be sure). boolean a = true,b = true,c = false; boolean original = (a || b) && c; // quick fix will allow the exchange to be performed if you position the cursor at the "&&" boolean swapped = c && a || b; // producing this expression assertTrue(!original); // ok assertEquals(original, swapped); // fail Reproducible: Always Steps to Reproduce: 1. Paste the code above 2. (confirm that the refactoring produces the expression assigned to "swapped") 3. Run the test
*** This bug has been marked as a duplicate of bug 149801 ***