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

Bug 536556

Summary: Save Actions erroneously removes modifiers in default methods that created an anonymous inner class from an interface
Product: [Eclipse Project] JDT Reporter: Michael Wiles <michael.wiles>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: noopur_gupta, stephan.herrmann
Version: 4.8   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Michael Wiles CLA 2018-07-01 15:26:54 EDT
Create an interface that looks like this:

public interface X {

    void B();
    
    void A();
    default  X y() {
        return new X() {

            @Override
            public void B() {
                // TODO Auto-generated method stub
                
            }

            @Override
            public void A() {
                // TODO Auto-generated method stub
                
            }
        };
    }
}

Save this interface with auto save remove redundant modifiers on...

It removes the public from methods A and B in the anonymous class created in deafult method y.

These public methods are not redundant as they are not on an interface but on a class.
Comment 1 Noopur Gupta CLA 2018-07-11 04:49:22 EDT

*** This bug has been marked as a duplicate of bug 536612 ***