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 131835 - Wrong setter implementation
Summary: Wrong setter implementation
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Beans (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
: 132284 134042 134446 135226 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-02 15:16 UTC by crosati
Modified: 2008-06-04 08:38 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 crosati 2008-04-02 15:16:40 UTC
Hi,

I've just downloaded NB 6.1 Dev 200804020004 in order to use the new property editor and I've found a wrong implementation of the setter method. This is a 
property just created:

	private Integer i2 = null;
	public static final String PROP_I2 = "i2";

	public Integer getI2 ()
	{
		return i2;
	}

	public void setI2 ( Integer i2 )
	{
		Integer oldI2 = i2;
		this.i2 = i2;
		propertyChangeSupport.firePropertyChange(PROP_I2, oldI2, i2);
	}

The implementation of the setter is wrong because the first statement should be:

		Integer oldI2 = this.i2;

or, even better:

		Integer oldI2 = getI2();

but certainly not what currently created.

Claudio
Comment 1 Jiri Prox 2008-04-08 08:30:40 UTC
*** Issue 132284 has been marked as a duplicate of this issue. ***
Comment 2 Jan Pokorsky 2008-04-08 19:00:49 UTC
fixed as http://hg.netbeans.org/main/rev/099396106e55
Comment 3 Jiri Prox 2008-04-15 09:34:41 UTC
verified in trunk.

It's good candidate for patch
Comment 4 pgebauer 2008-04-27 00:03:44 UTC
The fix has been ported into the release61_fixes branch:

http://hg.netbeans.org/release61_fixes/rev/6df438e82567
Comment 5 Jiri Prox 2008-04-29 11:01:08 UTC
*** Issue 134042 has been marked as a duplicate of this issue. ***
Comment 6 Jiri Prox 2008-05-03 14:16:05 UTC
*** Issue 134446 has been marked as a duplicate of this issue. ***
Comment 7 Jiri Prox 2008-05-19 09:08:26 UTC
*** Issue 135226 has been marked as a duplicate of this issue. ***