1 | private Constructor getProperConstructor(Class clazz) {↵ | | 1 | private Constructor getProperConstructor(Class clazz) {↵
|
2 | Constructor ctor = null;↵ | | 2 | Constructor ctor = null;↵
|
3 | try {↵ | | 3 | try {↵
|
4 | ctor = clazz.getDeclaredConstructor( COMPONENT_TUP_CTOR_SIG );↵ | | 4 | ctor = clazz.getDeclaredConstructor( ENTITY_TUP_CTOR_SIG );↵
|
5 | if ( ! ReflectHelper.isPublic( ctor ) ) {↵ | | 5 | if ( ! ReflectHelper.isPublic( ctor ) ) {↵
|
6 | try {↵ | | 6 | try {↵
|
7 | // found a ctor, but it was not publicly accessible so try to request accessibility↵ | | 7 | // found a ctor, but it was not publicly accessible so try to request accessibility↵
|
8 | ctor.setAccessible( true );↵ | | 8 | ctor.setAccessible( true );↵
|
9 | }↵ | | 9 | }↵
|
10 | catch ( SecurityException e ) {↵ | | 10 | catch ( SecurityException e ) {↵
|
11 | ctor = null;↵ | | 11 | ctor = null;↵
|
12 | }↵ | | 12 | }↵
|
13 | }↵ | | 13 | }↵
|
14 | }↵ | | 14 | }↵
|
15 | catch ( NoSuchMethodException ignore ) {↵ | | 15 | catch ( NoSuchMethodException ignore ) {↵
|
16 | }↵ | | 16 | }↵
|
|
17 | return ctor;↵ | | 17 | return ctor;↵
|
18 | | | 18 |
|