Polish
This commit is contained in:
parent
e5361d887c
commit
d6fe4b9a6a
|
|
@ -23,7 +23,6 @@ import java.net.URL;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
|
@ -273,11 +272,10 @@ public class Restarter {
|
|||
|
||||
private Throwable doStart() throws Exception {
|
||||
Assert.notNull(this.mainClassName, "Unable to find the main class to restart");
|
||||
ClassLoader parent = this.applicationClassLoader;
|
||||
URL[] urls = this.urls.toArray(new URL[this.urls.size()]);
|
||||
ClassLoaderFiles updatedFiles = new ClassLoaderFiles(this.classLoaderFiles);
|
||||
ClassLoader classLoader = new RestartClassLoader(parent, urls, updatedFiles,
|
||||
this.logger);
|
||||
ClassLoader classLoader = new RestartClassLoader(this.applicationClassLoader,
|
||||
urls, updatedFiles, this.logger);
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Starting application " + this.mainClassName + " with URLs "
|
||||
+ Arrays.asList(urls));
|
||||
|
|
@ -361,14 +359,8 @@ public class Restarter {
|
|||
}
|
||||
if (instance instanceof Map) {
|
||||
Map<?, ?> map = ((Map<?, ?>) instance);
|
||||
for (Iterator<?> iterator = map.keySet().iterator(); iterator.hasNext();) {
|
||||
Object value = iterator.next();
|
||||
if (value instanceof Class && ((Class<?>) value)
|
||||
.getClassLoader() instanceof RestartClassLoader) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
}
|
||||
map.keySet().removeIf(value -> value instanceof Class && ((Class<?>) value)
|
||||
.getClassLoader() instanceof RestartClassLoader);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -505,7 +497,7 @@ public class Restarter {
|
|||
|
||||
/**
|
||||
* Initialize restart support. See
|
||||
* {@link #initialize(String[], boolean, RestartInitializer)} for details.
|
||||
* {@link #initialize(String[], boolean, RestartInitializer, boolean)} for details.
|
||||
* @param args main application arguments
|
||||
* @param forceReferenceCleanup if forcing of soft/weak reference should happen on
|
||||
* @param initializer the restart initializer
|
||||
|
|
@ -559,7 +551,7 @@ public class Restarter {
|
|||
* Set the restarter instance (useful for testing).
|
||||
* @param instance the instance to set
|
||||
*/
|
||||
final static void setInstance(Restarter instance) {
|
||||
static void setInstance(Restarter instance) {
|
||||
synchronized (INSTANCE_MONITOR) {
|
||||
Restarter.instance = instance;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue