/** * Tries first to call {@link Class#forName(String)} with <code>className</code> as argument, then creates * a new object, casts it to a {@link Workaround}, and finally {@link #addWorkaround(Workaround) installs that workaround} * @param className the name of the class to install * @return <code>true</code> if a new Workaround was installed */ public static boolean tryAddWorkaround( String className ){ try{ Class<?> clazz = Class.forName( className, true, Workarounds.class.getClassLoader() ); Object instance = clazz.newInstance(); getDefault().addWorkaround( (Workaround)instance ); return true; } catch( Exception e ){ e.printStackTrace(); return false; } }