[
https://issues.apache.org/jira/browse/BVAL-108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16655430#comment-16655430
]
Matt Benson commented on BVAL-108:
----------------------------------
commit 796a2ca4474e29f28e6e047cafe4d4485ee8880d
> Prefer Thread context classloader or framework-relative as appropriate to
> task - addresses resource loading complaints with OSGI
> --------------------------------------------------------------------------------------------------------------------------------
>
> Key: BVAL-108
> URL: https://issues.apache.org/jira/browse/BVAL-108
> Project: BVal
> Issue Type: Bug
> Reporter: Ryan Heinen
> Priority: Major
> Fix For: 2.0.0
>
> Attachments: BVAL-108.patch
>
>
> The getClassLoader(Class clazz) method in PrivilegedActions.java will prefer
> the thread context class loader over the class loader available from the
> passed in type.
> This is unexpected when looking at the method, and appears to be a bug.
> Similar to BVAL-89 this fails in an OSGi environment.
> AnnotationProxyBuilder.createAnnotation uses this method to load annotations
> from types to be validated, and should be using the classloader of the
> requested type, or it will be unable to find them.
> This means that BVAL-89 is still an issue. Although that fix changed the
> createAnnotation method so it calls PrivilegedActions.getClassLoader, the
> getClassLoader is still returning the wrong class loader.
> The attached patch reverses the order of class loader retrieval in that
> method. If it is unable to get the class loader from the provided type, it
> will fall back to the thread context class loader rather than the other way
> around.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)