Remove unnecessary cast to URLClassLoader (#7603)

Java 9 and above will fail trying to cast the system classloader
This commit is contained in:
Xavier Léauté 2019-05-06 20:17:22 -07:00 committed by GitHub
parent 751e1c9ba7
commit c58aa2f2ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -116,7 +116,8 @@ public class InitializationTest
public void test04DuplicateClassLoaderExtensions() throws Exception
{
final File extensionDir = temporaryFolder.newFolder();
Initialization.getLoadersMap().put(extensionDir, (URLClassLoader) Initialization.class.getClassLoader());
Initialization.getLoadersMap()
.put(extensionDir, new URLClassLoader(new URL[]{}, Initialization.class.getClassLoader()));
Collection<DruidModule> modules = Initialization.getFromExtensions(new ExtensionsConfig(), DruidModule.class);