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 228709 - [Invert Boolean] Annotations are not supported by Invert Boolean
Summary: [Invert Boolean] Annotations are not supported by Invert Boolean
Status: NEW
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:
: 233768 (view as bug list)
Depends on: 230035
Blocks:
  Show dependency tree
 
Reported: 2013-04-18 13:52 UTC by Jiri Prox
Modified: 2015-04-07 07:10 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
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:52:52 UTC
Annotations are not supported by Invert Boolean refactoring. The usages are not changed and the default value is not inverted.

Example:
1) have an annotation

public @interface NewAnnotationType {
    boolean isOK() default true;
}

and a class

public class Test {
    @NewAnnotationType(isOK = true)
    public void test() {
    
    }
    
    private void annotationParser(NewAnnotationType annotationType) {
        if(annotationType.isOK()) {
            
        }
    }

}

2) call Invert Boolean on isOK method (and change name)

->
public @interface NewAnnotationType {
    boolean isNotOK() default true;   //<- the default value should be inverted
}

public class Test {
    @NewAnnotationType(isOK = true)  // <- method is not renamed, valued is not inverted
    public void test() {    
    }
    
    private void annotationParser(NewAnnotationType annotationType) {
        if(!annotationType.isNotOK()) {
            
        }
    }
}




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 Jiri Prox 2013-08-05 08:24:07 UTC
*** Bug 233768 has been marked as a duplicate of this bug. ***