Community
Participate
Working Groups
The addition of an N-ary operator could be a good improvement to prevent deep recursion. It could also simplify the code of the extended string literal. In this case we would preserve every part of the string literal concatenation and this would be an improvement for the ast conversion. Once this operator is in place, we should revisit bug 97220. A bit could be set on the string literal to prevent the warning from being generated and therefore it could simplify the filtering of those warnings depending on the context.
*** Bug 131718 has been marked as a duplicate of this bug. ***
tagged with 'greatbug' to convey information from dup bug. BTW, javac is failing as we do, due to deep recursion in algorithm. Also, a workaround is to pump up the size of the execution stack to accomodate such scenario using the command line argument: "-Xss"
The "greatbug" keyword needs to be justified as commented in bug 131718. In absence of any further explanation it isn't great any longer. Will soon timeout.
Timeout: Removed keyword
Created attachment 45289 [details] Suggested fix plus test cases The design point is to insert a CombinedBinaryExpression once in a while into deep String concatenations, CombinedBinaryExpression being a BinaryExpression which knows about intermediate nodes of its left branch, and which implements in a non recursive manner the most sensitive algorithms of BinaryExpression. See details into CombinedBinaryExpression and Parser. Patch currently under test.
Changing the title to better reflect what was finally agreed upon.
Released for 3.3 M1 The current implementation manages to compile smoothly string concatenations that result into method bodies multiple times larger than the current code size limit for method bodies. The design could be generalized to other operators if needed. Verifier please look at XLargeTest#10 and following. Opening a separate bug to track the code formatter behavior in extreme cases.
Created attachment 45372 [details] TARGET_321 compatible patch Also improves homogeneity checking and tests suite.
Added org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.test625 to handle the code formatter side of this issue. Changes in org.eclipse.jdt.internal.formatter.BinaryExpressionFragmentBuilder and org.eclipse.jdt.internal.formatter.CodeFormatterVisitor. Fixed and released in HEAD.
Maxime, Be sure to also release the fix for bug 151118 if you backport to 3.2.1.
Verified for 3.3 M1 using build I20060807-0010.