| Summary: | [formatter] Formating java file breaks NLS (//$NON-NLS-1$) comments | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Sébastien Gandon <sgandon> | ||||
| Component: | Core | Assignee: | Mateusz Matela <mateusz.matela> | ||||
| Status: | VERIFIED DUPLICATE | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P5 | CC: | manoj.palat, mateusz.matela | ||||
| Version: | 3.1.1 | ||||||
| Target Milestone: | 4.7 M6 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 2000 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Sébastien Gandon
Could you please provide a test case? This is supposed to be handled. Created attachment 32586 [details]
Seb's formated pref file for this bug
just create a new java class and add the following line
displayNamelbl.setText(SignalingMessages.getString("AitPropertiesCompositeControlProvider.0")); // Generated //$NON-NLS-1$
(this is only one line)
import the attached pref and do Ctrl+Shif+F and you'll see the //$NON-NLS-1$ go to the next line.
What happens if you remove // Generated ? it works perfectly, so indeed this is a bug (side effect) of the // generated comment. shall I rename the bug, create a new one or leave this one (I'd rather) SeB. Leave this one open. This is a bug on our side. Looking at the code this should also be supported. We simply check if the line comment contains //$NON-NLS-. I'll investigate, but not immediately. This is a bug in the comment formatter. If you disable comment formatting for now, it should work. I'll work later on the comment formatter. The comment formatter should not format line comment that contains NLS tags. Since 3.3M5, you can disable the line comment formatting from other comment formatting (block or javadoc). Ownership has changed for the formatter, but I surely will not have enough time to fix your bug during the 3.5 development process, hence set its priority to P5. Please provide a patch if you definitely need the bug to be fixed in this version and I'll have a look at it... TIA This bug no longer occurs after the formatter redesign. *** This bug has been marked as a duplicate of bug 303519 *** Verified for Eclipse Oxygen 4.7 M6 Build id: I20170305-2000 |