diff options
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/plugins/PluginInstaller.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/plugins/PluginInstaller.java b/sonar-core/src/main/java/org/sonar/core/plugins/PluginInstaller.java index 3be1816658c..94c2c6f4bad 100644 --- a/sonar-core/src/main/java/org/sonar/core/plugins/PluginInstaller.java +++ b/sonar-core/src/main/java/org/sonar/core/plugins/PluginInstaller.java @@ -62,11 +62,7 @@ public class PluginInstaller { if (metadata.getPathsToInternalDeps().length > 0) { // needs to unzip the jar - ZipUtils.unzip(pluginFile, pluginBasedir, new ZipUtils.ZipEntryFilter() { - public boolean accept(ZipEntry entry) { - return entry.getName().startsWith("META-INF/lib"); - } - }); + ZipUtils.unzip(pluginFile, pluginBasedir, new LibFilter()); for (String depPath : metadata.getPathsToInternalDeps()) { File dependency = new File(pluginBasedir, depPath); if (!dependency.isFile() || !dependency.exists()) { @@ -91,6 +87,12 @@ public class PluginInstaller { } } + private static class LibFilter implements ZipUtils.ZipEntryFilter { + public boolean accept(ZipEntry entry) { + return entry.getName().startsWith("META-INF/lib"); + } + } + public DefaultPluginMetadata extractMetadata(File file, boolean isCore) { try { PluginManifest manifest = new PluginManifest(file); @@ -133,7 +135,7 @@ public class PluginInstaller { metadata.setName(pluginInstance.getName()); } catch (Exception e) { - throw new RuntimeException("The metadata main class can not be created. Plugin file=" + pluginFile.getName() + ", class=" + mainClass, e); + throw new IllegalStateException("The metadata main class can not be created. Plugin file=" + pluginFile.getName() + ", class=" + mainClass, e); } } } |