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

Bug 573625

Summary: Formatter off/on is not honored in an enum file
Product: [Eclipse Project] JDT Reporter: Nas Kavian <nasrollah.kavian>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 4.19   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Nas Kavian CLA 2021-05-19 02:33:45 EDT
The alignment is lost when the file is saved, since the formatter comment is not being honored. The '@formatter: off' works fine when I use it a class method for example, just not here in an enum.

public enum PaymentService {

    // @formatter: off
    ADYEN_COMPONENTS_CC       ("adyen", "adyen",       AdyenPaymentEngine.class, PaymentServiceFeature.ADYEN_COMPONENTS_CC, Currency.ADYEN_CC,          "enable3DSecure"),
    ADYEN_COMPONENTS_PAYPAL   ("adyen", "paypal",      AdyenPaymentEngine.class, PaymentServiceFeature.ADYEN_PAYPAL,        Currency.ADYEN_PAYPAL,      null),
    ADYEN_DIRECT_CC           ("adyen", "adyen",       AdyenPaymentEngine.class, PaymentServiceFeature.ADYEN_DIRECT_CC,     Currency.ADYEN_CC,          "enable3DSecure"),
    ADYEN_REDIRECT_IDEAL      ("adyen", "ideal",       AdyenPaymentEngine.class, PaymentServiceFeature.ADYEN_IDEAL,         Currency.ADYEN_IDEAL,       null),
    ADYEN_REDIRECT_PAYSAFECARD("adyen", "paysafecard", AdyenPaymentEngine.class, PaymentServiceFeature.ADYEN_PAYSAFECARD,   Currency.ADYEN_PAYSAFECARD, null),
    ADYEN_REDIRECT_SOFORT     ("adyen", "sofort",      AdyenPaymentEngine.class, PaymentServiceFeature.ADYEN_SOFORT,        Currency.ADYEN_SOFORT,      null),
    ADYEN_REDIRECT_TRUSTLY    ("adyen", "trustly",     AdyenPaymentEngine.class, PaymentServiceFeature.ADYEN_TRUSTLY,       Currency.ADYEN_TRUSTLY,     null),
    // @formatter: on

....

}
Comment 1 Mateusz Matela CLA 2021-05-19 08:24:27 EDT
Are you sure you're using the right comment tag? Normally there's no space: @formatter:off
Comment 2 Nas Kavian CLA 2021-05-19 14:15:41 EDT
very sorry, my keyboard is broke, thank you for catching that. verified it works correctly.