This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 137431

Summary: Redundant public modifier for interface methods when "create method" is used
Product: java Reporter: modelka <modelka>
Component: HintsAssignee: Ralph Ruijs <ralphbenjamin>
Status: NEW ---    
Severity: blocker CC: gualtiero65, markiewb, tnleeuw
Priority: P3    
Version: 6.x   
Hardware: Other   
OS: Solaris   
Issue Type: ENHANCEMENT Exception Reporter:

Description modelka 2008-06-17 13:54:13 UTC
From the JLS:
"It is permitted, but strongly discouraged as a matter of style, to redundantly specify the public modifier for
interface methods."
But when "Create method" is used the method is created with the 'public' modifier.

To reproduce:

1. Create the next interface:

public interface Visitor {

    void visit(String aThis);

}

2. Write somewhere
visitor.visit(new Integer(0));

3. Click "Create method visit(Integer) in ....

Result:

public interface Visitor {

    public void visit(Integer aThis);
    
    void visit(String aThis);
}

Should be:

public interface Visitor {

    void visit(Integer aThis);
    
    void visit(String aThis);
}
Comment 1 markiewb 2013-10-05 14:08:09 UTC
*** Bug 182087 has been marked as a duplicate of this bug. ***
Comment 2 markiewb 2013-11-25 23:18:44 UTC
*** Bug 236167 has been marked as a duplicate of this bug. ***