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 236167 - create method on Interface should not use modifiers like public
Summary: create method on Interface should not use modifiers like public
Status: RESOLVED DUPLICATE of bug 137431
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-20 07:40 UTC by gualtiero65
Modified: 2013-11-25 23:18 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Editor showing "create method" hint (9.07 KB, image/png)
2013-09-20 07:40 UTC, gualtiero65
Details
Result in the interface (6.27 KB, image/png)
2013-09-20 07:41 UTC, gualtiero65
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gualtiero65 2013-09-20 07:40:36 UTC
Created attachment 140274 [details]
Editor showing "create method" hint

The "Create method" hint creates the method on the referred instance definition.

If the instance is an interface (in the picture 1 I'm adding a method on a Dao which is an interface not a class), the modifier public should not be added. 

Modifiers should not be specified in a interface.

See picture 2 for the current create method result.

The correct result should be:

boolean scriveConvivente(String ID_PAZ_SENZA_CONVIVENTE, String idConvivente);

without the public modifiers.
Comment 1 gualtiero65 2013-09-20 07:41:16 UTC
Created attachment 140275 [details]
Result in the interface
Comment 2 Svata Dedic 2013-09-27 07:57:31 UTC
The public modifier is added as a convention; however it is redundant. The declaration style is even not consistent across JDK sources and the presence or absence of the modifier is usually a subject to local code convention. Should be configurable, defaulting to NOT add redundant modifiers.
Comment 3 markiewb 2013-11-25 23:18:43 UTC
Duplicate of #137431 

Please vote there.

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