Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 442064

Summary: [formatter]whitespace is removed before line comment which switches formatter off
Product: [Eclipse Project] JDT Reporter: Stepan Kolesnik <wigbam>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: VERIFIED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: manoj.palat, mateusz.matela
Version: 4.4   
Target Milestone: 4.18 M3   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Stepan Kolesnik CLA 2014-08-19 09:47:48 EDT
In the following example, the whitespace between //@formatter:off and opening curly bracket is removed after formatting the code:

public class FormatterOnOffTest { // this is fine
    FormatterOnOffTest() { //@formatter:off
    } //@formatter:on
}

In preferences I have 'Preserve white space between code and line comments' checked.

Might be releated to Bug 377914:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=377914
Comment 1 Eclipse Genie CLA 2020-10-11 20:26:22 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Mateusz Matela CLA 2020-10-25 16:59:01 EDT
Just checked with 4.5 and 4.18.
This bug no longer occurs after the formatter redesign.

*** This bug has been marked as a duplicate of bug 303519 ***
Comment 3 Manoj N Palat CLA 2020-11-18 04:30:08 EST
Verified for Eclipse 4.18 M3 Version: 2020-12 (4.18) with Build id: I20201117-0600