@Test public void loadClassWithNullCustomClassloader() throws ClassNotFoundException{ OSGiStartProcessEngineStep step = new OSGiStartProcessEngineStep(mock(ProcessEngineXml.class), mock(BundleContext.class)); String clazz = "java.lang.Object"; Class<? extends Object> loadedClazz = step.loadClass(clazz, null, null); assertThat(loadedClazz.getName(), is(Object.class.getName())); }
@Override @SuppressWarnings("unchecked") protected <T> Class<? extends T> loadClass(String className, ClassLoader customClassloader, Class<T> clazz) { Class<? extends T> configurationClass = null; if(customClassloader != null) { try { configurationClass = (Class<? extends T>) customClassloader.loadClass(className); } catch(ClassNotFoundException e) { } } if(customClassloader == null || configurationClass == null) { configurationClass = (Class<? extends T>) ReflectUtil.loadClass(className); } return configurationClass; }
OSGiStartProcessEngineStep extends StartProcessEngineStep { @Override @SuppressWarnings("unchecked") protected <T> Class<? extends T> loadClass(String className, ClassLoader customClassloader, Class<T> clazz) { Class<? extends T> configurationClass = null; if(customClassloader != null) { try { configurationClass = (Class<? extends T>) customClassloader.loadClass(className); } catch(ClassNotFoundException e) { } } if(customClassloader == null || configurationClass == null) { configurationClass = (Class<? extends T>) ReflectUtil.loadClass(className); } return configurationClass; } }
OSGiStartProcessEngineStep extends StartProcessEngineStep { @Override @SuppressWarnings("unchecked") protected <T> Class<? extends T> loadClass(String className, ClassLoader customClassloader, Class<T> clazz) { Class<? extends T> configurationClass = null; if(customClassloader != null) { try { configurationClass = (Class<? extends T>) customClassloader.loadClass(className); } catch(ClassNotFoundException e) { } } if(customClassloader == null || configurationClass == null) { configurationClass = (Class<? extends T>) ReflectUtil.loadClass(className); } return configurationClass; } OSGiStartProcessEngineStep(ProcessEngineXml processEngineXml, BundleContext context); }
OSGiStartProcessEngineStep extends StartProcessEngineStep { @Override @SuppressWarnings("unchecked") protected <T> Class<? extends T> loadClass(String className, ClassLoader customClassloader, Class<T> clazz) { Class<? extends T> configurationClass = null; if(customClassloader != null) { try { configurationClass = (Class<? extends T>) customClassloader.loadClass(className); } catch(ClassNotFoundException e) { } } if(customClassloader == null || configurationClass == null) { configurationClass = (Class<? extends T>) ReflectUtil.loadClass(className); } return configurationClass; } OSGiStartProcessEngineStep(ProcessEngineXml processEngineXml, BundleContext context);  }
OSGiStartProcessEngineStep extends StartProcessEngineStep { @Override @SuppressWarnings("unchecked") protected <T> Class<? extends T> loadClass(String className, ClassLoader customClassloader, Class<T> clazz) { Class<? extends T> configurationClass = null; if(customClassloader != null) { try { configurationClass = (Class<? extends T>) customClassloader.loadClass(className); } catch(ClassNotFoundException e) { } } if(customClassloader == null || configurationClass == null) { configurationClass = (Class<? extends T>) ReflectUtil.loadClass(className); } return configurationClass; } OSGiStartProcessEngineStep(ProcessEngineXml processEngineXml, BundleContext context);   }