Changeset 7227

Nov 15, 2016, 2:47:32 PM (6 years ago)
Nicklas Nordborg

References #2041: Support for extension points within extensions

This should get rid of the problem that a scan for changes only once. The problem was that if a change was detected in a JAR file, the ExtensionsFile.validate() method was called which, as a side-effect, nullified the current JAR class loader. This caused a second scan to think that everyting was up to date. The class loader is no longer reset when validating, but only if a change has been detected and the getClassLoader() method is called.

1 edited


  • trunk/src/core/net/sf/basedb/util/extensions/manager/

    r7226 r7227  
    426426    hasError = false;
    427427    validationError = null;
    428     jarLoader = null;
    430429    InputStream in = null;
    575574  /**
    576575    Get the class loader used to load classes for the extension. Only JAR
    577     files have class loaders so this method may return null.
     576    files have class loaders so this method may return null. Once a class
     577    loader has been created it remains the same until a change has been detected
     578    with {@link #checkModified()} which forces the creation of a new class loader
     579    when this method is called.
    578580  */
    579581  public ClassLoader getClassLoader()
    580582    throws IOException
    581583  {
    582     if (jarLoader == null && isJar())
     584    if ((jarLoader == null || wasModified) && isJar())
    583585    {
    584586      jarLoader = (JarClassLoader)JarClassLoader.getInstance(getFile().getAbsolutePath(), true);
Note: See TracChangeset for help on using the changeset viewer.