Project: JDT
Bug 330415 [inline] Refactor > Inline fails to parenthesize replaced arguments
Reported: 2010-11-16 19:07:25 | Status: resolved fixed

Build Identifier: M20100211-1343 Inlining a subtracted expression produces the wrong result because the refactoring tool fails to parenthesize the arguments. Example: instead of x - (y + z), you can end up with x - y + z. (See attached test case). Reproducible: Always Steps to Reproduce: 1. Run the test case as-is. 2. Inline each of the functions in main(). 3. Run the test case again and observe the difference.

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_in/TestDiffDiff.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_in/TestDivideDivide.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_in/TestPlusDiff.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_in/TestTimesDivide.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_in/TestTimesTimes.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_out/TestDiffDiff.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_out/TestDivideDivide.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_out/TestPlusDiff.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_out/TestPlusPlus.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_out/TestTimesDivide.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/operator_out/TestTimesTimes.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SourceProvider.java