fix error messages in InstantiationExceptions
This commit is contained in:
parent
2355f98586
commit
608e4ef6d6
|
@ -52,7 +52,7 @@ public class EmbeddableInstantiatorPojoIndirecting extends AbstractPojoInstantia
|
|||
return constructor.newInstance( values );
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new InstantiationException( "Could not instantiate entity: ", getMappedPojoClass(), e );
|
||||
throw new InstantiationException( "Could not instantiate entity", getMappedPojoClass(), e );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class EmbeddableInstantiatorPojoIndirecting extends AbstractPojoInstantia
|
|||
return constructor.newInstance( values );
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new InstantiationException( "Could not instantiate entity: ", getMappedPojoClass(), e );
|
||||
throw new InstantiationException( "Could not instantiate entity", getMappedPojoClass(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class EmbeddableInstantiatorPojoStandard extends AbstractPojoInstantiator
|
|||
public Object instantiate(ValueAccess valuesAccess, SessionFactoryImplementor sessionFactory) {
|
||||
if ( isAbstract() ) {
|
||||
throw new InstantiationException(
|
||||
"Cannot instantiate abstract class or interface: ", getMappedPojoClass()
|
||||
"Cannot instantiate abstract class or interface", getMappedPojoClass()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ public class EmbeddableInstantiatorPojoStandard extends AbstractPojoInstantiator
|
|||
return instance;
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new InstantiationException( "Could not instantiate entity: ", getMappedPojoClass(), e );
|
||||
throw new InstantiationException( "Could not instantiate entity", getMappedPojoClass(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class EmbeddableInstantiatorRecordIndirecting extends EmbeddableInstantia
|
|||
return constructor.newInstance( values );
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new InstantiationException( "Could not instantiate entity: ", getMappedPojoClass(), e );
|
||||
throw new InstantiationException( "Could not instantiate entity", getMappedPojoClass(), e );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class EmbeddableInstantiatorRecordIndirecting extends EmbeddableInstantia
|
|||
return constructor.newInstance( values );
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new InstantiationException( "Could not instantiate entity: ", getMappedPojoClass(), e );
|
||||
throw new InstantiationException( "Could not instantiate entity", getMappedPojoClass(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class EmbeddableInstantiatorRecordStandard extends AbstractPojoInstantiat
|
|||
return constructor.newInstance( valuesAccess.getValues() );
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new InstantiationException( "Could not instantiate entity: ", getMappedPojoClass(), e );
|
||||
throw new InstantiationException( "Could not instantiate entity", getMappedPojoClass(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,17 +95,17 @@ public class EntityInstantiatorPojoStandard extends AbstractEntityInstantiatorPo
|
|||
@Override
|
||||
public Object instantiate(SessionFactoryImplementor sessionFactory) {
|
||||
if ( isAbstract() ) {
|
||||
throw new InstantiationException( "Cannot instantiate abstract class or interface: ", getMappedPojoClass() );
|
||||
throw new InstantiationException( "Cannot instantiate abstract class or interface", getMappedPojoClass() );
|
||||
}
|
||||
else if ( constructor == null ) {
|
||||
throw new InstantiationException( "No default constructor for entity: ", getMappedPojoClass() );
|
||||
throw new InstantiationException( "No default constructor for entity", getMappedPojoClass() );
|
||||
}
|
||||
else {
|
||||
try {
|
||||
return applyInterception( constructor.newInstance( (Object[]) null ) );
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new InstantiationException( "Could not instantiate entity: ", getMappedPojoClass(), e );
|
||||
throw new InstantiationException( "Could not instantiate entity", getMappedPojoClass(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public class ManagedBeanRegistryInitiator implements StandardServiceInitiator<Ma
|
|||
return (BeanContainer) containerClass.newInstance();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new InstantiationException( "Unable to instantiate specified BeanContainer : " + containerClass.getName(), containerClass, e );
|
||||
throw new InstantiationException( "Unable to instantiate specified BeanContainer", containerClass, e );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -90,20 +90,20 @@ public class PojoInstantiator implements Instantiator, Serializable {
|
|||
|
||||
public Object instantiate() {
|
||||
if ( isAbstract ) {
|
||||
throw new InstantiationException( "Cannot instantiate abstract class or interface: ", mappedClass );
|
||||
throw new InstantiationException( "Cannot instantiate abstract class or interface", mappedClass );
|
||||
}
|
||||
else if ( optimizer != null ) {
|
||||
return optimizer.newInstance();
|
||||
}
|
||||
else if ( constructor == null ) {
|
||||
throw new InstantiationException( "No default constructor for entity: ", mappedClass );
|
||||
throw new InstantiationException( "No default constructor for entity", mappedClass );
|
||||
}
|
||||
else {
|
||||
try {
|
||||
return applyInterception( constructor.newInstance( (Object[]) null ) );
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new InstantiationException( "Could not instantiate entity: ", mappedClass, e );
|
||||
throw new InstantiationException( "Could not instantiate entity", mappedClass, e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue