Community
Participate
Working Groups
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.
Created attachment 183272 [details] This is a test case to demonstrate the bug (requires manual steps; see file).
Issues with Eclipse's Java tooling goes to JDT.
Created attachment 183275 [details] fix + tests It is better to add extra parenthesis in some cases e.g. x + (y + z) , than change the semantics on inlining.
Fixed in HEAD.