@Test public void testInstantiateWithNoConstructor() { assertNotNull(ReflectionUtils.newInstance(NoConstructorPerson.class)); }
@SuppressWarnings("unchecked") public static <T> T newInstance(Class<T> pojoClass) { try { return instantiate(pojoClass); } catch (ReflectiveOperationException e) { throw new HecateException(e, "Unable to instantiate object of type %s.", pojoClass.getCanonicalName()); } }
ReflectionUtils { @SuppressWarnings("unchecked") public static <T> T newInstance(Class<T> pojoClass) { try { return instantiate(pojoClass); } catch (ReflectiveOperationException e) { throw new HecateException(e, "Unable to instantiate object of type %s.", pojoClass.getCanonicalName()); } } }
ReflectionUtils { @SuppressWarnings("unchecked") public static <T> T newInstance(Class<T> pojoClass) { try { return instantiate(pojoClass); } catch (ReflectiveOperationException e) { throw new HecateException(e, "Unable to instantiate object of type %s.", pojoClass.getCanonicalName()); } } private  ReflectionUtils(); }
ReflectionUtils { @SuppressWarnings("unchecked") public static <T> T newInstance(Class<T> pojoClass) { try { return instantiate(pojoClass); } catch (ReflectiveOperationException e) { throw new HecateException(e, "Unable to instantiate object of type %s.", pojoClass.getCanonicalName()); } } private  ReflectionUtils(); @SuppressWarnings("unchecked") static T newInstance(Class<T> pojoClass); }
ReflectionUtils { @SuppressWarnings("unchecked") public static <T> T newInstance(Class<T> pojoClass) { try { return instantiate(pojoClass); } catch (ReflectiveOperationException e) { throw new HecateException(e, "Unable to instantiate object of type %s.", pojoClass.getCanonicalName()); } } private  ReflectionUtils(); @SuppressWarnings("unchecked") static T newInstance(Class<T> pojoClass);  }