Changeset 7227


Ignore:
Timestamp:
Nov 15, 2016, 2:47:32 PM (5 years ago)
Author:
Nicklas Nordborg
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/util/extensions/manager/ExtensionsFile.java

    r7226 r7227  
    426426    hasError = false;
    427427    validationError = null;
    428     jarLoader = null;
    429428   
    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.