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 228708 - [Invert Boolean] Disable invert refactoring for overriding methods
Summary: [Invert Boolean] Disable invert refactoring for overriding methods
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-18 13:34 UTC by Jiri Prox
Modified: 2015-03-09 10:52 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 Jiri Prox 2013-04-18 13:34:56 UTC
The @Override annotation should be removed when calling Invert Boolean on overriding method and changing name.

Steps to reproduce:
1) have a interface:
public interface Iface {    
    public boolean test();   
}

and a implementing class with method :
    @Override
    public boolean test() {
        return true;
    }

2) call Invert Boolean on this method and in the dialog change  the name

-> the @Override annotation is invalid
-> the new method does not override the method from interface (the class is not compilable)


Product Version: NetBeans IDE Dev (Build 201304162301)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b82
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
Comment 1 Ralph Ruijs 2013-04-18 13:52:13 UTC
Jirka,

I'm sorry but I have to disagree. The @Override annotation was added to show the intention, simply removing it could change the external behavior. Maybe disable renaming, if the method is overridden/overriding?
Comment 2 Jiri Prox 2013-04-18 13:56:48 UTC
Yes, disabling rename for overriding methods may solve both problems
Comment 3 Ralph Ruijs 2015-03-09 10:52:42 UTC
Fixed by: 37908ebff3f7