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 219140 - Encapsulate Field setter with PCS does not throw property changes
Summary: Encapsulate Field setter with PCS does not throw property changes
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-27 20:56 UTC by mklaehn
Modified: 2012-10-02 02:25 UTC (History)
1 user (show)

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 mklaehn 2012-09-27 20:56:50 UTC
Using the refactoring Encapsulate field with generation Property Change Support for setter of variable (i.e. id) results in the following code:

    private Integer id;
    public void setId(Integer id) {
        java.lang.Integer oldId = id;
        this.id = id;
        propertyChangeSupport.firePropertyChange(PROP_ID, oldId, id);
    }

oldId and id are the same value thus no property change is thrown.

The assignment to oldValue should be prefixed by "this.".
java.lang.Integer oldId = this.id;
Comment 1 Ralph Ruijs 2012-10-01 07:18:42 UTC
http://hg.netbeans.org/jet-main/rev/2dc2d466006a
Comment 2 Quality Engineering 2012-10-02 02:25:06 UTC
Integrated into 'main-golden', will be available in build *201210020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2dc2d466006a
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #219140 - Encapsulate Field PCS changed to use longName