[jboss-jira] [JBoss JIRA] Created: (JBREFLECT-99) AbstractIsLocalResourcePlugin.isSameInParent relies on ClassLoader.getResource instead of ClassPool.find

Flavia Rainone (JIRA) jira-events at lists.jboss.org
Fri Feb 26 18:16:10 EST 2010


AbstractIsLocalResourcePlugin.isSameInParent relies on ClassLoader.getResource instead of ClassPool.find
--------------------------------------------------------------------------------------------------------

                 Key: JBREFLECT-99
                 URL: https://jira.jboss.org/jira/browse/JBREFLECT-99
             Project: JBoss Reflection
          Issue Type: Bug
          Components: Class Pool
    Affects Versions: JBossReflection.2.2.0-Alpha3
            Reporter: Flavia Rainone
            Assignee: Flavia Rainone
             Fix For:  JBossReflection.2.2.0-Alpha4


This bug has been covered by the old vfs (version 2):

rotected boolean isSameInParent(String classResourceName, URL foundURL)
   {
      ClassPool  parent = pool.getParent(); 
      if (parent != null)
      {
         ClassLoader parentLoader = parent.getClassLoader();
         URL parentURL = parentLoader.getResource(classResourceName);
         if (parentURL == null)
         {
            return false;
         }
         URI parentURI = URI.create(parentURL.toString());
         URI foundURI = URI.create(foundURL.toString());
         if (parentURI.equals(foundURI))
         {
            return true;
         }
      }
      return false;
}

The lines that try to create a URI from the URL fail, since the URL would return a vfs:// file. With VFS 3, the URL contains file:// instead, thus affecting the result of the method and uncovering the error.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list