From 22d7927e3c8e7dff0ae7e16728c3ef7af9b74fdb Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 5 Nov 2010 15:46:38 +0000 Subject: [PATCH] #5957 - ClassPathExplorer should show UnsupportedClassVersionError svn changeset:15887/svn branch:6.4 --- .../gwt/widgetsetutils/ClassPathExplorer.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java b/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java index 06876e44c5..b215717ee0 100644 --- a/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java +++ b/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java @@ -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()); } } -- 2.39.5