static Map nuObjectWithoutArguments_cache = newDangerousWeakHashMap(); static O nuObjectWithoutArguments(S className) ctex { ret nuObjectWithoutArguments(classForName(className)); } static A nuObjectWithoutArguments(Class c) ctex { if (nuObjectWithoutArguments_cache == null) // in class init ret (A) nuObjectWithoutArguments_findConstructor(c).newInstance(); Constructor m = nuObjectWithoutArguments_cache.get(c); if (m == null) nuObjectWithoutArguments_cache.put(c, m = nuObjectWithoutArguments_findConstructor(c)); return (A) m.newInstance(); } static Constructor nuObjectWithoutArguments_findConstructor(Class c) { for (Constructor m : getDeclaredConstructors_cached(c)) if (empty(m.getParameterTypes())) { makeAccessible(m); ret m; } fail("No default constructor found in " + c.getName()); }