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 236490

Summary: [Encapsulate field] Setter with property change support is invalid for static fields
Product: java Reporter: Jiri Prox <jiriprox>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description Jiri Prox 2013-09-27 19:00:02 UTC
Generated setter for static field is accessing instance field although it is static

1) have a class with static field
2) encapsulate filed with property change support

-> 
   public static void setField(int aField) throws PropertyVetoException {
        int oldField = field;
        vetoableChangeSupport.fireVetoableChange(PROP_FIELD, oldField, field);
        field = aField;
        propertyChangeSupport.firePropertyChange(PROP_FIELD, oldField, field);
    }

but vetoableChangeSupport and propertyChangeSupport is instance field


Product Version: NetBeans IDE 7.4 RC2 (Build 201309252201)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b14
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\7.4rc2
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\7.4rc2
Comment 1 Martin Balin 2015-09-17 11:16:04 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.
Comment 2 Jiri Prox 2015-09-17 19:00:06 UTC
Still valid in

Product Version: NetBeans IDE Dev (Build 201509170002)
Updates: Updates available
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
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 3 Martin Balin 2016-07-07 07:18:46 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss