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 6986 - code is not properly updated when bean property is renamed
Summary: code is not properly updated when bean property is renamed
Status: RESOLVED DUPLICATE of bug 45358
Alias: None
Product: java
Classification: Unclassified
Component: Beans (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 enhancement with 1 vote (vote)
Assignee: issues@java
URL:
Keywords:
: 12161 (view as bug list)
Depends on: 17825
Blocks:
  Show dependency tree
 
Reported: 2000-07-05 19:47 UTC by Alexei Barski
Modified: 2007-02-05 23:50 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 Alexei Barski 2000-07-05 19:47:25 UTC
Create a bean in your project and a property with read and write methods:

.....
	private String sampleProperty;
.....
	public String getSampleProperty {
		return sampleProperty;
	}

	public void setSampleProperty(String value) {
		String oldValue = sampleProperty;
		sampleProperty = value;
		propertySupport.firePropertyChange(PROP_SAMPLE_PROPERTY, oldValue,
sampleProperty);
	}
.....

Go to Explorer, find the bean, drill down to 'Bean Patterns', right click
on the property name, select 'Rename'; type in new name, press 'OK', answer yes
to the question that pops up.

You now have:
.....
	private String asdf;
.....
	public String getAsdf {
		return sampleProperty;
	}

	public void setAsdf(String value) {
		String oldValue = sampleProperty;
		sampleProperty = value;
		propertySupport.firePropertyChange(PROP_SAMPLE_PROPERTY, oldValue,
sampleProperty);
	}
.....
Comment 1 Petr Hrebejk 2000-09-22 10:09:59 UTC
*** Bug 4723 has been marked as a duplicate of this bug. ***
Comment 2 Petr Suchomel 2001-05-15 16:21:44 UTC
*** Issue 12161 has been marked as a duplicate of this issue. ***
Comment 3 Svata Dedic 2001-11-19 12:13:59 UTC
It can be worked around (without #17825), but not if the user 
already edited the methods' code. Complete metamodel is required to 
find/change the setter/getter pattern.
Comment 4 Svata Dedic 2002-05-21 17:01:58 UTC
Cleaning up
Comment 5 Marek Grummich 2002-07-19 17:10:28 UTC
Target milestone was changed from not determined to TBD
Comment 6 _ proxity 2006-02-09 10:59:47 UTC
I have the same problem in 5.0. I did not alter the generated code. I simply
added the property and renamed it immediately. It took a while, but nothing was
update in the buffer. See java.lang.IllegalStateException in attached messages.log.

Seems to be really broken in 5.0
Comment 7 _ sandipchitale 2006-10-23 18:54:35 UTC
I see the problem in Netbeans 5.5 RC2. If there are references to the property 
in other places those are not updated either.
Comment 8 Jan Pokorsky 2006-12-19 12:48:49 UTC
The refactoring for the Beans Pattern node has been never implemented. We would
like to offer beans refactoring actions inside the editor but the Beans Pattern
node will not be part of the NetBeans 6.0. Anyway there already exists an
enhancement for this so closing as duplicate in case the plans will change.

*** This issue has been marked as a duplicate of 45358 ***