[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: PackageInformation retrieved from wrong jar

scott.stark@jboss.org do-not-reply at jboss.com
Sat Sep 13 23:44:40 EDT 2008


Why we are returning the wrong package is that the search for the matching file via the findVirtualFileInfo is not precisce enough to locate a package. We just find the first matching file:


  |    protected VirtualFileInfo findVirtualFileInfo(String path)
  |    {
  |       VirtualFileInfo result = vfsCache.get(path);
  |       if (result != null)
  |          return result;
  |       
  |       for (VirtualFile root : roots)
  |       {
  |          try
  |          {
  |             // Any jar with a class in the package or a subpackage will have a match
  |             VirtualFile file = root.getChild(path);
  | 

Stan's patch requires that the match either be a file that is a leaf, or a directory that contains at least one leaf. Since this method is only used to find class files or packages, this seems like an acceptable restriction. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176348#4176348

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176348



More information about the jboss-dev-forums mailing list