Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-808

R4SearchPolicyCore.searchDynamicImports() always loads a class even if the object to load is a resource

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • framework-1.4.0
    • framework-1.4.1
    • None
    • None

    Description

      The method R4SearchPolicyCore.searchDynamicImports( IModule module, String name, String pkgName, boolean isClass) always load a class by using the current thrad class loader even if the object to laod is a resource.

      This code may chek if the object is a class or a resource, and invoke the coresponding method on the classloader.

      // If there are no bundles providing exports for this
      // package and if the instigating class was not from a
      // bundle, then delegate to the parent class loader.
      // Otherwise, break out of loop and return null.
      boolean delegate = true;
      for (ClassLoader cl = classes[i].getClassLoader(); cl != null; cl = cl.getClass().getClassLoader())
      {
      if (ContentClassLoader.class.isInstance(cl))

      { delegate = false; break; }

      }
      if (delegate)

      { return this.getClass().getClassLoader().loadClass(name); }

      Attachments

        Activity

          People

            rickhall Richard S. Hall
            eyindanga eyindanga
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: