JDK-4467312 : Javadoc for Encoder.setPersistenceDelegate is incomlete.
  • Type: Bug
  • Component: docs
  • Sub-Component: guides
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 2001-06-07
  • Updated: 2004-03-29
  • Resolved: 2003-08-11
Related Reports
Duplicate :  
Description

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)

======================================================================

Comments
EVALUATION Should close as a duplicate of 4491682. ###@###.### 2003-08-11
11-08-2003