File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed
engine/src/main/java/org/hibernate/validator/internal/util Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -244,8 +244,6 @@ GroupDefinitionException getUnableToExpandDefaultGroupListException(@FormatWith(
244
244
IllegalArgumentException getInvalidLengthOfParameterMetaDataListException (String executableName , int nbParameters , int listSize );
245
245
246
246
@ Message (id = 63 , value = "Unable to instantiate %s." )
247
- ValidationException getUnableToInstantiateException (String className , @ Cause Exception e );
248
-
249
247
ValidationException getUnableToInstantiateException (@ FormatWith (ClassObjectFormatter .class ) Class <?> clazz , @ Cause Exception e );
250
248
251
249
@ Message (id = 64 , value = "Unable to instantiate %1$s: %2$s." )
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public final class ConstructorInstance<T> implements PrivilegedAction<T> {
29
29
private final Object [] initArgs ;
30
30
31
31
public static <T > ConstructorInstance <T > action (Constructor <T > constructor , Object ... initArgs ) {
32
- return new ConstructorInstance <T >( constructor , initArgs );
32
+ return new ConstructorInstance <>( constructor , initArgs );
33
33
}
34
34
35
35
private ConstructorInstance (Constructor <T > constructor , Object ... initArgs ) {
@@ -42,17 +42,8 @@ public T run() {
42
42
try {
43
43
return constructor .newInstance ( initArgs );
44
44
}
45
- catch (InstantiationException e ) {
46
- throw log .getUnableToInstantiateException ( constructor .getName (), e );
47
- }
48
- catch (IllegalAccessException e ) {
49
- throw log .getUnableToInstantiateException ( constructor .getName (), e );
50
- }
51
- catch (InvocationTargetException e ) {
52
- throw log .getUnableToInstantiateException ( constructor .getName (), e );
53
- }
54
- catch (RuntimeException e ) {
55
- throw log .getUnableToInstantiateException ( constructor .getName (), e );
45
+ catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) {
46
+ throw log .getUnableToInstantiateException ( constructor .getDeclaringClass (), e );
56
47
}
57
48
}
58
49
}
You can’t perform that action at this time.
0 commit comments