]> source.dussan.org Git - vaadin-framework.git/commitdiff
Throw ExceptionInInitializerError instead of printing the stack trace to console.
authorArtur Signell <artur.signell@itmill.com>
Tue, 9 Mar 2010 17:51:19 +0000 (17:51 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 9 Mar 2010 17:51:19 +0000 (17:51 +0000)
svn changeset:11735/svn branch:6.3

src/com/vaadin/tools/ReflectTools.java

index 2db10574eae0bd9240dd0e8f637fca98b2f172ec..1fe36bd5e7a685bc7ba191ab1e0e1a709e309bc3 100644 (file)
@@ -25,15 +25,16 @@ public class ReflectTools {
      * @param parameterTypes
      *            The parameter types for the method.
      * @return A reference to the method
+     * @throws ExceptionInInitializerError
+     *             Wraps any exception in an {@link ExceptionInInitializerError}
+     *             so this method can be called from a static initializer.
      */
     public static Method findMethod(Class<?> cls, String methodName,
-            Class<?>... parameterTypes) {
+            Class<?>... parameterTypes) throws ExceptionInInitializerError {
         try {
             return cls.getDeclaredMethod(methodName, parameterTypes);
         } catch (Exception e) {
-            // Print the stack trace as
-            e.printStackTrace(System.err);
+            throw new ExceptionInInitializerError(e);
         }
-        return null;
     }
 }