Navigation Menu

Skip to content

Commit

Permalink
Two improvement in class loading:
Browse files Browse the repository at this point in the history
- done earlier, set the context class loader so log4j can use it
- class path is build using a list, not a set to keep order declaration
  • Loading branch information
fbacchella committed Jul 25, 2016
1 parent b256245 commit 092c7e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/jrds/PropertiesManager.java
Expand Up @@ -160,7 +160,7 @@ public boolean accept(File file) {
}
};

Collection<URI> urls = new HashSet<URI>();
Collection<URI> urls = new ArrayList<URI>();

if(extendedclasspath != null && !"".equals(extendedclasspath)) {
for(String pathElement: extendedclasspath.split(";")) {
Expand Down Expand Up @@ -319,6 +319,11 @@ public void update() {
// **********************
// The log configuration

// The class loader is configured early, it can be used by log4j
extensionClassLoader = doClassLoader(getProperty("classpath", ""));

// log4j uses the contextClassLoader, set it so it can uses fancy appenders
Thread.currentThread().setContextClassLoader(extensionClassLoader);
// Log configuration is done early
boolean nologging = parseBoolean(getProperty("nologging", "false"));
String log4jXmlFile = getProperty("log4jxmlfile", "");
Expand Down Expand Up @@ -476,7 +481,6 @@ public void update() {
libspath.add(lib.toURI());
}
}
extensionClassLoader = doClassLoader(getProperty("classpath", ""));

//
// Tab configuration
Expand Down

0 comments on commit 092c7e6

Please sign in to comment.