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 151733 - Extract interface/superclass uses package-private access for methods
Summary: Extract interface/superclass uses package-private access for methods
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker with 1 vote (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-29 15:33 UTC by shadewind
Modified: 2013-01-10 17:33 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
The class (141 bytes, text/plain)
2008-10-29 16:24 UTC, shadewind
Details
The extracted interface (243 bytes, text/plain)
2008-10-29 16:24 UTC, shadewind
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shadewind 2008-10-29 15:33:23 UTC
When using Extract Interface or Extract Superclass refactoring, the resulting interface or superclass uses
package-private access for all methods even if the original methods are declared public. This is obviously not
appropriate behavior. Use the same access as the original (preferred) or use public always.
Comment 1 Jiri Prox 2008-10-29 16:13:58 UTC
I cannot reproduce it.  Can you provide the source?

Note that keyword public is implicit for methods in interface.



Comment 2 shadewind 2008-10-29 16:24:14 UTC
Created attachment 72839 [details]
The class
Comment 3 shadewind 2008-10-29 16:24:46 UTC
Created attachment 72840 [details]
The extracted interface
Comment 4 Jiri Prox 2008-10-29 16:49:32 UTC
The method is still public - it is defined in interface
Comment 5 shadewind 2008-10-29 17:05:50 UTC
You are correct about extract superclass, that one works. But I'd prefer if the methods could be specified explicitly as
public as I know that me and many others like doing that (for example, most of the Java SE interfaces do this).
Comment 6 Jiri Prox 2008-10-29 18:02:01 UTC
I see, so let's mark this issue as enhancement
Comment 7 Ralph Ruijs 2013-01-10 17:33:20 UTC
From JLS ยง9.4: "It is permitted, but discouraged as a matter of style, to redundantly specify the public and/or abstract modifier for a method declared in an interface."

Marking as wontfix.