Skip to content

Commit

Permalink
Fix for #851: do not close system ClassLoader
Browse files Browse the repository at this point in the history
or any other not created by GroovyClassLoaderFactory
  • Loading branch information
eric-milles committed Mar 23, 2019
1 parent f25db8b commit d53b857
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -88,8 +88,7 @@ private static void close(ClassLoader classLoader) {
}
if (classLoader instanceof GroovyClassLoader) {
((GroovyClassLoader) classLoader).clearCache();
}
if (classLoader.getParent() instanceof URLClassLoader) {
// parent was created by newClassLoader(...)
close(classLoader.getParent());
}
}
Expand Down

0 comments on commit d53b857

Please sign in to comment.