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.
Generation of bounded and/or constrained properties (using "insert code -> add property ..."): Problem in the set-method: Example: import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; public class Borrower { private String name; public static final String PROP_NAME = "name"; /** * Get the value of name * * @return the value of name */ public String getName() { return name; } /** * Set the value of name * * @param name new value of name */ public void setName(String name) { String oldName = name; PROBLEM, should be String oldName = this.name this.name = name; propertyChangeSupport.firePropertyChange(PROP_NAME, oldName, name); } private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); /** * Add PropertyChangeListener. * * @param listener */ public void addPropertyChangeListener(PropertyChangeListener listener) { propertyChangeSupport.addPropertyChangeListener(listener); } /** * Remove PropertyChangeListener. * * @param listener */ public void removePropertyChangeListener(PropertyChangeListener listener) { propertyChangeSupport.removePropertyChangeListener(listener); } }
Thanks for the report. It was already fixed and the fix will be part of NB 6.1 patch. *** This issue has been marked as a duplicate of 133153 ***