Community
Participate
Working Groups
Created attachment 261581 [details] The file that the formatter gets stuck on. When trying to format the attached file with the Eclipse formatter while the setting formatter.join_wrapped_lines=true is set, the formatter hangs.
Created attachment 261582 [details] The full formatter settings.
New Gerrit change created: https://git.eclipse.org/r/81644
(In reply to Eclipse Genie from comment #2) > New Gerrit change created: https://git.eclipse.org/r/81644 I had to change a lot in the line wrapping implementation, mainly drop recursion and use my own data structures as processing stack. With that, I managed to get rid of the exception throwing mechanism. Also with some aggressive optimizations, large files should be now a lot less problematic. Using the occasion, I did some refactoring of WrapMode enum and surrounding code: new value FORCE for "Force wrap" policies, renamed FORCED to BLOCK_INDENT (I don't know why the old name ever seemed reasonable to me). Manoj, requesting a review as this is a major change. There may be some new bugs, bug in the long run the code should be easier to maintain, and there's probably a few unknown bugs fixed by this patch. I hope the new test is sufficient. I was testing on a 32bit jvm and without the fix I just got stack overflow before experiencing any freeze. Changes in existing tests: - test477476: lines force-wrapped by line comments or region limits are no longer touched, even if an additional wrap inside would result in a better score. This is more consistent with the behavior for "Never join already wrapped lines". - testBug465669(): the algorithm is better at minimizing line width overflow when keeping within the line limit is impossible
Gerrit change https://git.eclipse.org/r/81644 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=1ff5bcf85044ab1209a1245d0c1ac7cf273fe3fe
This causes a test failure in JDT UI: http://download.eclipse.org/eclipse/downloads/drops4/I20161011-0800/testresults/html/org.eclipse.jdt.ui.tests_ep47I-unit-lin64_linux.gtk.x86_64_8.0.html
New Gerrit change created: https://git.eclipse.org/r/83054
(In reply to Dani Megert from comment #5) > This causes a test failure in JDT UI: The test result has changed as per comment 3: > lines force-wrapped by line comments or region limits are no longer touched, > even if an additional wrap inside would result in a better score. This is > more consistent with the behavior for "Never join already wrapped lines". (In reply to Eclipse Genie from comment #6) > New Gerrit change created: https://git.eclipse.org/r/83054 The affected lines now go back to the state they were before bug 303519.
Gerrit change https://git.eclipse.org/r/83054 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=0bf3861df65c9abb61dd0f4a3b1d45d8db8ea516
(In reply to Mateusz Matela from comment #7) > (In reply to Dani Megert from comment #5) > > This causes a test failure in JDT UI: > > The test result has changed as per comment 3: > > lines force-wrapped by line comments or region limits are no longer touched, > > even if an additional wrap inside would result in a better score. This is > > more consistent with the behavior for "Never join already wrapped lines". > > (In reply to Eclipse Genie from comment #6) > > New Gerrit change created: https://git.eclipse.org/r/83054 > The affected lines now go back to the state they were before bug 303519. Thanks, makes sense. I've reviewed and merged the change.
Verified for 4.7 M3 with build I20161024-2000