]> source.dussan.org Git - sonarqube.git/commitdiff
Add some comments
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 24 Jul 2012 07:48:02 +0000 (09:48 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 24 Jul 2012 07:48:02 +0000 (09:48 +0200)
sonar-core/src/main/java/org/sonar/core/plugins/PluginClassloaders.java

index 2b2c27600be717bbaef25613a9163deb5873aa75..a53effc5c34bf3665f32f426fd78edc60f6a5b64 100644 (file)
@@ -123,6 +123,10 @@ public class PluginClassloaders {
       }
       return realm;
     } catch (Throwable e) {
+      // SONAR-3688
+      // Throwable is explicitely caught instead of Exception in order to log the plugins
+      // that are compiled for Java > 5. In such case java.lang.UnsupportedClassVersionError
+      // is raised. 
       throw new SonarException("Fail to build the classloader of " + plugin.getKey(), e);
     }
   }
@@ -144,6 +148,10 @@ public class PluginClassloaders {
       }
       return true;
     } catch (Throwable e) {
+      // SONAR-3688
+      // Throwable is explicitely caught instead of Exception in order to log the plugins
+      // that are compiled for Java > 5. In such case java.lang.UnsupportedClassVersionError
+      // is raised. 
       throw new SonarException("Fail to extend the plugin " + plugin.getBasePlugin() + " for " + plugin.getKey(), e);
     }
   }
@@ -208,8 +216,10 @@ public class PluginClassloaders {
       return (Plugin) claz.newInstance();
 
     } catch (Throwable e) {
-      // Do not catch only Exception in order to detect the plugins compiled for Java > 5
-      // (it raises a java.lang.UnsupportedClassVersionError)
+      // SONAR-3688
+      // Throwable is explicitely caught instead of Exception in order to log the plugins
+      // that are compiled for Java > 5. In such case java.lang.UnsupportedClassVersionError
+      // is raised. 
       throw new SonarException("Fail to load plugin " + metadata.getKey(), e);
     }
   }