Community
Participate
Working Groups
Build ID: M20060921-0945 Steps To Reproduce: format the following code snippet: int i = 0; int k = + ++i; results in: int i = 0; int k = +++i; ^^^^ Invalid argument to operation ++/-- More information: it is quite untypical to use the unary operator+ followed by prefix increment operator. The reason to use it at all is, to make the code more readable. Here my original code snippet: /* check for terminal symbols*/ switch (translated = ALPHABET[read]) { case TERMINAL_SYMBOL: step = - ++wordIndex; break; default: step = + ++wordIndex; break; } ^^^^
Created attachment 58255 [details] Proposed fix
Fix is trivial. Philippe, I guess too late for 3.2.2?
Created attachment 58256 [details] Regression tests
Released for 3.3M6. Regression tests added in org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test650/653
Regression two more tests added in org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test654/655
Verified for 3.3 M6 using build I20070320-0010