> On Jun 21, 2016, at 10:39 AM, Daniel Fuchs <daniel.fu...@oracle.com> wrote:
> 
> Hi,
> 
> Please find below a somewhat trivial patch for
> 
> 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
> 
> This is an oversight that was introduced with JDK-8145104.
> 
> The issue is simply that newInstance() must be invoked on
> the concrete class, not on the class that defines the
> createContext method.

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).

 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.

Mandy

Reply via email to