Name: dsR10051 Date: 06/07/2001
Javadoc for method
java.beans.Encoder.setPersistenceDelegate(Class type, PersistenceDelegate persistenceDelegate)
does not declare NullPointerException if the value of
persistenceDelegate parameter is null.
This behavior should be documented.
Here is example:
import java.beans.*;
public class EncoderTest02 {
public static void main(String[] args) {
Encoder enc = new Encoder();
Class type = java.math.BigInteger.class;
PersistenceDelegate persistenceDelegate = null;
enc.setPersistenceDelegate(type, persistenceDelegate);
System.out.println("OKAY");
}
}
--- Output ---
java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
bash-2.03$ java EncoderTest02
Exception in thread "main" java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:380)
at java.beans.FeatureDescriptor.setValue(FeatureDescriptor.java:168)
at java.beans.MetaData.setPersistenceDelegate(MetaData.java:728)
at java.beans.Encoder.setPersistenceDelegate(Encoder.java:154)
at EncoderTest02.main(EncoderTest02.java:9)
======================================================================