diff -r 70d15cf323ba -r 777b9b841f15 launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Console.java --- a/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Console.java Tue Dec 25 14:07:02 2012 +0100 +++ b/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Console.java Mon Jan 07 17:22:59 2013 +0100 @@ -21,9 +21,8 @@ import java.io.InputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import java.net.URL; -import java.net.URLDecoder; -import java.net.URLEncoder; import java.util.Enumeration; import org.apidesign.bck2brwsr.core.JavaScriptBody; @@ -113,7 +112,7 @@ return sb.toString(); } - static String invoke(String clazz, String method) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException { + static String invoke(String clazz, String method) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, InstantiationException { final Object r = invokeMethod(clazz, method); return r == null ? "null" : r.toString().toString(); } @@ -151,7 +150,8 @@ private static Object invokeMethod(String clazz, String method) throws ClassNotFoundException, InvocationTargetException, - SecurityException, IllegalAccessException, IllegalArgumentException { + SecurityException, IllegalAccessException, IllegalArgumentException, + InstantiationException { Method found = null; Class c = Class.forName(clazz); for (Method m : c.getMethods()) { @@ -161,7 +161,11 @@ } Object res; if (found != null) { - res = found.invoke(null); + if ((found.getModifiers() & Modifier.STATIC) != 0) { + res = found.invoke(null); + } else { + res = found.invoke(c.newInstance()); + } } else { res = "Can't find method " + method + " in " + clazz; }