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

Bug 431857

Summary: [formatter] with line wrap, in consistent behavior of annotation indentation on methods anonymous classes.
Product: [Eclipse Project] JDT Reporter: Yang Shan <yshan.andrew>
Component: CoreAssignee: Manoj N Palat <manoj.palat>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: manoj.palat
Version: 4.3.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
A file to show all the different ways I have found to create anonymous classes, and how the @Override annotation behaves in each case. none

Description Yang Shan CLA 2014-04-02 22:07:57 EDT
Created attachment 241535 [details]
A file to show all the different ways I have found to create anonymous classes, and how the @Override annotation behaves in each case.

Hello,
I would like the annotation on my method declarations to have the same indent as my method.
Ex:
public class MyListenter implements SomeInterface {
    @Override
    public void reallyLongInterfaceFunction(
        String reallyLongInterfaceParameter) {
    }
}

However, if I use anonymous classes and I want default indentation for line wrap to be 2, the @Override will have 2 indents
SomeInterface shotName = new SomeInterface() {
        @Override
    public void reallyLongInterfaceFunction(
        String reallyLongInterfaceParameter) {
    }
};

I would prefer annotations to match the indent of whatever it is they are annotating.

I have attached a file to show all the different ways I have found to create anonymous classes, and how the @Override annotation behaves in each case.

I have tried changing the formatter settings, but it always breaks at least one of the cases.

If someone can find a formatter case that works, please let me know. Lines should be 100 characters max and default indent on line wrapping should be 2.

Thank you
Comment 1 Eclipse Genie CLA 2020-04-16 13:39:20 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.