Commit 14685850 authored by Andy Wilkinson's avatar Andy Wilkinson

Synchronize on class loading lock in RestartClassLoader

Closes gh-12171
parent 413847c7
/*
* Copyright 2012-2015 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -142,6 +142,7 @@ public class RestartClassLoader extends URLClassLoader implements SmartClassLoad
if (file != null && file.getKind() == Kind.DELETED) {
throw new ClassNotFoundException(name);
}
synchronized (getClassLoadingLock(name)) {
Class<?> loadedClass = findLoadedClass(name);
if (loadedClass == null) {
try {
......@@ -156,6 +157,7 @@ public class RestartClassLoader extends URLClassLoader implements SmartClassLoad
}
return loadedClass;
}
}
@Override
protected Class<?> findClass(final String name) throws ClassNotFoundException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment