Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 468288 - Java code formatter incorrectly formats line comments *not* starting on first column if the option to never indent line comments on first column is enabled
Summary: Java code formatter incorrectly formats line comments *not* starting on first...
Status: RESOLVED DUPLICATE of bug 303519
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.5   Edit
Assignee: Mateusz Matela CLA
QA Contact:
URL:
Whiteboard: To be verified for 4.6 M6
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-26 06:09 EDT by Markus Schöpflin CLA
Modified: 2016-03-15 03:41 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Schöpflin CLA 2015-05-26 06:09:44 EDT
When enabling the Java code formatting options 'Enable line comment formatting' and 'Never indent line comments on first column', automatically wrapped line comments are incorrectly formatted.

Instead of 

    int bar2(); // This is a long comment that should be split in multiple
                // line comments in case the line comment formatting is enabled

you get:

    int bar2(); // This is a long comment that should be split in multiple
// line comments in case the line comment formatting is enabled

This can be seen directly on the comments tab of the Java code formatting options. Simply set the line width to e.g. 100 characters and toggle the option 'Never indent line comments on first column'.
Comment 1 Mateusz Matela CLA 2016-03-13 18:27:27 EDT
This problem no longer occurs after the formatter redesign.

*** This bug has been marked as a duplicate of bug 303519 ***
Comment 2 Markus Schöpflin CLA 2016-03-14 08:49:51 EDT
Does that mean it should work in 4.5.2? (I'm asking because it definitely doesn't work for me.)
Comment 3 Mateusz Matela CLA 2016-03-14 10:00:11 EDT
Yes, I could easily reproduce the bug in 4.4.1 but not in 4.5.2.
Could you test it with a freshly download Eclipse and see if the bug occurs right away or after importing your formatter profile or other settings or after installing specific plugins?
Comment 4 Markus Schöpflin CLA 2016-03-15 03:41:31 EDT
Works on a freshly downloaded install, but not on my upgraded installation. Time to reinstall Eclipse then. Thank you.