Hi Mandy,

On 21/06/16 20:51, Mandy Chung wrote:
8150173: JAXBContext.newInstance causes PrivilegedActionException
        when createContext's declared in absract class extended
        by discovered JAXB implementation
https://bugs.openjdk.java.net/browse/JDK-8150173

Patch:
http://cr.openjdk.java.net/~dfuchs/webrev_8150173/webrev.00

Thanks for taking this one on.

 234             if (JAXBContextFactory.class.isAssignableFrom(declaringClass)

The spec says that implementation class of JAXBContextFactory must also 
implement no-arg constructor.

So I think this line is not needed.  Instead instantiateProviderIfNecessary 
should simply take the implClass parameter (the Method parameter doesn’t seem 
to be needed).


Oh! You're right of course - it's much easier to understand without
the Method clutter.

 245             throw new 
JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, declaringClass, 
e), e);

Since you are on this file, it looks to me that it should use e.getCause() 
instead of e.

Good catch!

Here the new version:
http://cr.openjdk.java.net/~dfuchs/webrev_8150173/webrev.01/

Thanks for the feedback!

-- daniel


Reply via email to