[shrinkwrap-issues] [JBoss JIRA] Commented: (SHRINKWRAP-253) ClassAsset / ClassLoaderAsset should not use TCCL

Aslak Knutsen (JIRA) jira-events at lists.jboss.org
Tue Mar 15 08:38:45 EDT 2011


    [ https://issues.jboss.org/browse/SHRINKWRAP-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588013#comment-12588013 ] 

Aslak Knutsen commented on SHRINKWRAP-253:
------------------------------------------

{panel:title=JavaDoc Class.getResourceAsStream}
Finds a resource with a given name. The rules for searching resources associated with a given class are implemented by the defining class loader of the class. This method delegates to this object's class loader. If this object was loaded by the bootstrap class loader, the method delegates to ClassLoader.getSystemResourceAsStream(java.lang.String).
{panel}


Wouldn't simply using this work as expected?

{code}
return clazz.getResourceAsStream(getResourceNameOfClass(clazz));
{code}



> ClassAsset / ClassLoaderAsset should not use TCCL
> -------------------------------------------------
>
>                 Key: SHRINKWRAP-253
>                 URL: https://issues.jboss.org/browse/SHRINKWRAP-253
>             Project: ShrinkWrap
>          Issue Type: Bug
>            Reporter: Aslak Knutsen
>
> ClassAsset.openStream should not fall back to using TCCL if class.getClassLoader is null. That means it's a System resource and static ClassLoader.getResourceAsStream should be used instead. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the shrinkwrap-issues mailing list