commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commit-cp] [bugs #10799] PropertyEditorSupport::setValue throws excepti


From: Robert Schuster
Subject: [commit-cp] [bugs #10799] PropertyEditorSupport::setValue throws exception when oldVal is null
Date: Tue, 26 Oct 2004 17:59:03 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.3) Gecko/20040930

This mail is an automated notification from the bugs tracker
 of the project: classpath.

/**************************************************************************/
[bugs #10799] Latest Modifications:

Changes by: 
                Robert Schuster <address@hidden>
'Date: 
                Tue 10/26/2004 at 21:51 (GMT)

------------------ Additional Follow-up Comments ----------------------------
[(Error - Not Found)]
> "If both the new and the old values are null, no property
> change event should be fired."
IMHO this is not true. A PropertyEditorSupport provides no property name (its 
null). The doc for PropertyChangeEvent says when there is no property name, the 
old and the new value should be null, too. Now, for each change (even null for 
null or oldValue being equal to newValue) the change event is thrown. 

If you change the value of a PropertyEditorSupport PES using 
PSE.setValue(whatEver) the following holds for the PropertyChangeEvent 
delivered to all registered PropertyChangeListeners:

PropertyChangeEvent pce
pce.getOldValue() == pce.getNewValue() == null

(as said pce.getPropertyName() is null, too)

I know that this is horribly confusing but its specified that way in 
PropertyChangeEvent. Rest assured: I am going to stress this behaviour when I 
update the documentation.
:)






/**************************************************************************/
[bugs #10799] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10799>
Project: classpath
Submitted by: Matthew Chadwick
On: Mon 10/25/2004 at 20:17

Category:  classpath
Severity:  5 - Average
Resolution:  None
Privacy:  Public
Assigned to:  rschuster
Status:  In Process
Platform Version:  None


Summary:  PropertyEditorSupport::setValue throws exception when oldVal is null

Original Submission:  java.beans.PropertyEditorSupport's "public void 
setValue(Object value)" method throws a NullPointerException when oldVal is 
equal to null.  The method should check for cases where the old value is null.  
If both the new and the old values are null, no property change event should be 
fired.  If only the old value is null, a property change event should be fired.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Tue 10/26/2004 at 21:51       By: Robert Schuster <rschuster>
> "If both the new and the old values are null, no property
> change event should be fired."
IMHO this is not true. A PropertyEditorSupport provides no property name (its 
null). The doc for PropertyChangeEvent says when there is no property name, the 
old and the new value should be null, too. Now, for each change (even null for 
null or oldValue being equal to newValue) the change event is thrown. 

If you change the value of a PropertyEditorSupport PES using 
PSE.setValue(whatEver) the following holds for the PropertyChangeEvent 
delivered to all registered PropertyChangeListeners:

PropertyChangeEvent pce
pce.getOldValue() == pce.getNewValue() == null

(as said pce.getPropertyName() is null, too)

I know that this is horribly confusing but its specified that way in 
PropertyChangeEvent. Rest assured: I am going to stress this behaviour when I 
update the documentation.
:)

-------------------------------------------------------
Date: Tue 10/26/2004 at 21:17       By: Robert Schuster <rschuster>
thanks for report.

the fix is easy but I am going to write some mauve tests before I close the bug.



-------------------------------------------------------
Date: Mon 10/25/2004 at 20:32       By: Matthew Chadwick <mchadwick>
It appears that old value is also being set inappropriately.  (oldValue = val 
instead of oldValue = this.val).  Better variable names would improve the 
clarity here.












For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10799>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]