diff options
author | Jenkins CI <ci@sonarsource.com> | 2012-07-23 18:25:30 +0200 |
---|---|---|
committer | Jenkins CI <ci@sonarsource.com> | 2012-07-23 18:25:30 +0200 |
commit | 554202ed2dbbdc7aa3c231f2900939a3577748d7 (patch) | |
tree | 41c564c3c1e880a1c2df7ea30737ba3e57e24ec9 | |
parent | b7d658a3396df54ee1d4e0982ea31cbbe6b7e902 (diff) | |
parent | a0a52ddc782e95c38dfb1221064cbf72a41710f0 (diff) | |
download | sonarqube-554202ed2dbbdc7aa3c231f2900939a3577748d7.tar.gz sonarqube-554202ed2dbbdc7aa3c231f2900939a3577748d7.zip |
Automatic merge from branch-3.2
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java b/sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java index 11a762d7333..2b2c27600be 100644 --- a/sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java +++ b/sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java @@ -122,8 +122,8 @@ public class PluginClassloaders { realm.addURL(url); } return realm; - } catch (Exception e) { - throw new SonarException(e); + } catch (Throwable e) { + throw new SonarException("Fail to build the classloader of " + plugin.getKey(), e); } } @@ -143,8 +143,8 @@ public class PluginClassloaders { base.addURL(file.toURI().toURL()); } return true; - } catch (Exception e) { - throw new SonarException(e); + } catch (Throwable e) { + throw new SonarException("Fail to extend the plugin " + plugin.getBasePlugin() + " for " + plugin.getKey(), e); } } @@ -207,7 +207,9 @@ public class PluginClassloaders { Class claz = get(metadata.getKey()).loadClass(metadata.getMainClass()); return (Plugin) claz.newInstance(); - } catch (Exception e) { + } catch (Throwable e) { + // Do not catch only Exception in order to detect the plugins compiled for Java > 5 + // (it raises a java.lang.UnsupportedClassVersionError) throw new SonarException("Fail to load plugin " + metadata.getKey(), e); } } |