Bug 175533 - CustomizeJavaBeanAction doesn't reset the attribute value on explicitPropertyChange
Summary: CustomizeJavaBeanAction doesn't reset the attribute value on explicitProperty...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: VE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Joe Winchester CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-26 10:23 EST by Richard K. CLA
Modified: 2011-06-13 11:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard K. CLA 2007-02-26 10:23:42 EST
Build ID: M20070212-1330

Steps To Reproduce:
Set explicitPropertyChange in BeanInfo

a) Use a bean with a customizer to apply a property value (firePropertyChange("sample", oldvalue, newvalue)

b) Use the customizer and try to reset the value (firePropertyChange("sample", oldvalue,=>null)

example (generated source):
case a) bean.setSample( new Description[]{"Test", "Test"});
case b) bean.setSample is not removed as expected

Reason:
Class: org.eclipse.ve.internal.java.core.CustomizeJavaBeanAction
Method: recordProperyChange()
In the scenario the newBean instance is null => Exception

Following code (after creating the newBean instance) solves the problem:
if ( newBean == null) { 			commandBuilder.cancelAttributeSetting( aBean,(EStructuralFeature) propDesc.getId());
return;
}

=> now the 'bean.setSample(..)' line will be removed from the generated code

Contact me for any questions.

More information: