JDK-4506596 : NPE thrown when called on non-inited standard property editor for primitive bool
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 1.3.1
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_2.4
  • CPU: x86
  • Submitted: 2001-09-25
  • Updated: 2010-07-09
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b10Fixed
Related Reports
Relates :  
Description
linux jdk1.3.1  

Standard PropertyEditor for primitive boolean type, throws NPE instead of return null when its getAsText() method is called and there was not value set yet. I 
think its against bean spec. 
(I guess similar problem could cause setAsText method.)

I created testcase (see attachment).

Comments
SUGGESTED FIX I think getAsText method has to return null or value as formatted text.
11-06-2004

EVALUATION Test case output: editor=sun.beans.editors.BoolEditor@26b249 Exception in thread "main" java.lang.NullPointerException at sun.beans.editors.BoolEditor.getAsText(BoolEditor.java:30) at TestCase.main(TestCase.java:26) The value of that the property value represents has not been set so therefore, the getValue() method will be invalid. This should return null. I'm not sure what we are going to do with the standard sun property editors. We may replace them for the next version. ###@###.### 2002-01-14
14-01-2002