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 58187 - Tools->Synchronize incorrectly changes method visibility
Summary: Tools->Synchronize incorrectly changes method visibility
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-21 17:41 UTC by zacjacobson
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zacjacobson 2005-04-21 17:41:13 UTC
I have an abstract class that has such a method:

 protected abstract String doStuff( String request );

It's protected because I want users of my code to access it via the superclass.
In my subclass, to match, I have:

 protected final String doStuff( String request ) { // [...] }

When I run Tools->Synchronize on that subclass, the Confirm Changes dialog says:

 Update Method protected final java.lang.String doStuff(String) to protected
abstract java.lang.String doStuff(String).

That kindof makes sense.. so when I process that, this is the change it makes in
my subclass:

 protected final String doStuff( String request ) { // [...] }
to
 public final String doStuff( String request ) { // [...] }

Why would it change the visibility to public after it says it needs to satisfy
it as protected - especially after it says it needs to be protected? I think it
should use the same visibility as the abstract class defines. I definetly feel
it shouldn't change method visibility that already satisfies the abstract
method. This isn't an Interface, not everything needs to be public.
Comment 1 Martin Matula 2005-04-22 14:10:49 UTC
Dan, please look at it.
Comment 2 Jan Becicka 2005-08-22 15:55:51 UTC
Tools->Synchronize was removed. This bug is not valid any more.
Comment 3 zacjacobson 2005-08-22 17:33:21 UTC
Maybe the menu option for Tools->Synchronize was removed, but the synchronized
checks are still run on classes, and this problem still exists in IDE 4.1.

As soon as a class with the characteristics I describe before is changed, the
same "Confirm Changes" dialogue box comes up, and it wants to make the same
inappropriate changes.
Comment 4 Martin Matula 2005-08-22 18:12:05 UTC
As you can see from the target milestone, Tools->Synchronization was removed
from 4.2. NB 4.1 still contains it.