JDK-7080613 : java.beans.DefaultPersistenceDelegate.instantiate(..) doesn't throw NPE
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-08-18
  • Updated: 2017-05-16
  • Resolved: 2013-08-23
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 8
8 b110Fixed
Related Reports
Relates :  
Description
Specification for the following method says:

http://download.oracle.com/javase/7/docs/api/java/beans/DefaultPersistenceDelegate.html#instantiate%28java.lang.Object,%20java.beans.Encoder%29

Throws:
    NullPointerException - if out is null

This assertion is not satisfied. Please see the following code sample:


import java.beans.Encoder;
import java.beans.Expression;

public class DefaultPersistenceDelegate {

    public static void main(String[] args) {

        class MyPersistenceDelegate extends java.beans.DefaultPersistenceDelegate {
            @Override public Expression instantiate(Object oldInstance, Encoder out) {
                return super.instantiate(oldInstance, out);
            }
        }
        
        new MyPersistenceDelegate().instantiate(new Object(), (Encoder)null);
    }

}

The output will be blank.

Comments
Verified in jdk8b115 Javadoc updated
11-11-2013

EVALUATION It is a regression after the 6412286 fix.
20-08-2011