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.
if i create a class inheritates from Object, and use Bean Patterns to add properties to it, the Bean Patterns can generate 'propertyChangeSupport' and related 'addPropertyChangeListener' and 'removePropertyChangeListener' methods, and add 'propertyChangeSupport.firePropertyChange' call to the property's 'set' method. It is ok. But the issue is: if i create a class inheritates from 'JComponent', the 'propertyChangeSupport' and related methods are already built in. Now, when i use Bean Patterns to add a property: 1. if i choose 'Generate Property Change Support', it will add everything just like in the case when the class is inheritated from Object. But, all those 'propertyChangeSupport' and related methods are DUPLICATIONS with the ones already built in JComponent; 2. if i DONT choose 'Generate Property Change Support', then the 'firePropertyChanged' call would NOT added to the property's 'set' method. Is it possible that the 'Bean Patterns' check the existance of 'propertyChangeSupport' and related methods in the class before generate a new one? If they exist, then just use the exist ones. Thank you.
This featurre has been implemented since 3.2. Now it does not work. I fix it ASAP.
Target milestone -> 3.3.1.
Increasing priority; from a quick look, it can be accomplished with the current infrastructure.
Cleaning up
Target milestone was changed from not determined to TBD
Improving summary, it was so vague as to be useless before. If this was really working in 3.2, then it is a regression that it has been broken in the last two releases, right? Hence DEFECT?
I agree that this should be treated as defect. For a Component subclasses you would need to override all add/remove/fire methods a do it carefully to correctly notify listeners added in contructor before new PCS is created in this subclass. So at least warn user that the action can break existing code if there are already addPCL/removePCL methods.
This issue is not valid any more. PCL support is generated through completion and you see, what is being added and it is up to, what you want.
:-( Alt-Ins | Add property gives me a dialog where I can customize. That's right and at least 'generate PCS' is off by default. OTOH it is bad if the tool helps me to write bad code. Perhaps a hint in editor that overriding {add,remove}PCL is strange can help (code smell).