|
21 | 21 |
|
22 | 22 | import java.io.File; |
23 | 23 | import java.net.URLClassLoader; |
24 | | -import java.security.AccessController; |
25 | | -import java.security.PrivilegedAction; |
26 | 24 | import java.util.List; |
27 | 25 | import java.util.Map; |
28 | 26 | import javax.annotation.Nullable; |
@@ -70,20 +68,18 @@ public IsolatedLauncherAndClassloader createLauncher(Map<String, String> props, |
70 | 68 | } |
71 | 69 |
|
72 | 70 | IsolatedLauncherAndClassloader createLauncher(final JarDownloader jarDownloader, final ClassloadRules rules) { |
73 | | - return AccessController.doPrivileged((PrivilegedAction<IsolatedLauncherAndClassloader>) () -> { |
74 | | - try { |
75 | | - List<File> jarFiles = jarDownloader.download(); |
76 | | - logger.debug("Create isolated classloader..."); |
77 | | - var cl = createClassLoader(jarFiles, rules); |
78 | | - IsolatedLauncher objProxy = IsolatedLauncherProxy.create(cl, IsolatedLauncher.class, launcherImplClassName, logger); |
79 | | - tempCleaning.clean(); |
| 71 | + try { |
| 72 | + List<File> jarFiles = jarDownloader.download(); |
| 73 | + logger.debug("Create isolated classloader..."); |
| 74 | + var cl = createClassLoader(jarFiles, rules); |
| 75 | + IsolatedLauncher objProxy = IsolatedLauncherProxy.create(cl, IsolatedLauncher.class, launcherImplClassName, logger); |
| 76 | + tempCleaning.clean(); |
80 | 77 |
|
81 | | - return new IsolatedLauncherAndClassloader(objProxy, cl); |
82 | | - } catch (Exception e) { |
83 | | - // Catch all other exceptions, which relates to reflection |
84 | | - throw new ScannerException("Unable to execute SonarScanner analysis", e); |
85 | | - } |
86 | | - }); |
| 78 | + return new IsolatedLauncherAndClassloader(objProxy, cl); |
| 79 | + } catch (Exception e) { |
| 80 | + // Catch all other exceptions, which relates to reflection |
| 81 | + throw new ScannerException("Unable to execute SonarScanner analysis", e); |
| 82 | + } |
87 | 83 | } |
88 | 84 |
|
89 | 85 | public static class IsolatedLauncherAndClassloader implements AutoCloseable { |
|
0 commit comments