]> source.dussan.org Git - vaadin-framework.git/commitdiff
#5957 - ClassPathExplorer should show UnsupportedClassVersionError
authorArtur Signell <artur.signell@itmill.com>
Fri, 5 Nov 2010 15:46:38 +0000 (15:46 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 5 Nov 2010 15:46:38 +0000 (15:46 +0000)
svn changeset:15887/svn branch:6.4

src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java

index 06876e44c58ee2dea70dfd5af475fb38d586d30d..b215717ee0c2be0b3180b54a3d2f172c6352163b 100644 (file)
@@ -526,7 +526,7 @@ public class ClassPathExplorer {
         PrintStream out = System.out;
         PrintStream err = System.err;
         Throwable errorToShow = null;
-
+        Level logLevel = null;
         try {
             System.setErr(devnull);
             System.setOut(devnull);
@@ -543,32 +543,31 @@ public class ClassPathExplorer {
             // Inform the user about this as the class might contain a Paintable
             // Typically happens when using an add-on that is compiled using a
             // newer Java version.
+            logLevel = Level.INFO;
             errorToShow = e;
         } catch (ClassNotFoundException e) {
             // Don't show to avoid flooding the user with irrelevant messages
-            if (logger.isLoggable(Level.FINE)) {
-                errorToShow = e;
-            }
+            logLevel = Level.FINE;
+            errorToShow = e;
         } catch (LinkageError e) {
             // Don't show to avoid flooding the user with irrelevant messages
-            if (logger.isLoggable(Level.FINE)) {
-                errorToShow = e;
-            }
+            logLevel = Level.FINE;
+            errorToShow = e;
         } catch (Exception e) {
             // Don't show to avoid flooding the user with irrelevant messages
-            if (logger.isLoggable(Level.FINE)) {
-                errorToShow = e;
-            }
+            logLevel = Level.FINE;
+            errorToShow = e;
         } finally {
             System.setErr(err);
             System.setOut(out);
         }
 
         // Must be done here after stderr and stdout have been reset.
-        if (errorToShow != null) {
-            logger.warning("Failed to load class " + fullclassName + ". "
-                    + errorToShow.getClass().getName() + ": "
-                    + errorToShow.getMessage());
+        if (errorToShow != null && logLevel != null) {
+            logger.log(logLevel,
+                    "Failed to load class " + fullclassName + ". "
+                            + errorToShow.getClass().getName() + ": "
+                            + errorToShow.getMessage());
         }
     }