RadLayoutManager (final Class aClass) { // we can't use isInstance() because the class in our map and aClass may have been loaded with // different classloaders for(Map.Entry<Class, Class<? extends RadLayoutManager>> e: ourLayoutManagerClassRegistry.entrySet()) { if (e.getKey().getName().equals(aClass.getName())) { try { return e.getValue().newInstance(); } catch (Exception ex) { throw new RuntimeException(ex); } } } if (aClass.getSuperclass() != null) { return createFromLayoutClass(aClass.getSuperclass()); } return null; }