try {
ctor = clazz.getDeclaredConstructor( COMPONENT_TUP_CTOR_SIG );
if ( ! ReflectHelper.isPublic( ctor ) ) {
try {
// found a ctor, but it was not publicly accessible so try to request accessibility
ctor.setAccessible( true );
}
catch ( SecurityException e ) {
ctor = null;
}
}
}
catch ( NoSuchMethodException ignore ) {
}
try {
ctor = clazz.getDeclaredConstructor( ENTITY_TUP_CTOR_SIG );
if ( ! ReflectHelper.isPublic( ctor ) ) {
try {
// found a ctor, but it was not publicly accessible so try to request accessibility
ctor.setAccessible( true );
}
catch ( SecurityException e ) {
ctor = null;
}
}
}
catch ( NoSuchMethodException ignore ) {
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/component/ComponentTuplizerFactory.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java
|
Method name: Constructor getProperConstructor(Class)
|
|
Method name: Constructor getProperConstructor(Class)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | try {↵ | | 1 | try {↵
|
2 | ctor = clazz.getDeclaredConstructor( COMPONENT_TUP_CTOR_SIG );↵ | | 2 | ctor = clazz.getDeclaredConstructor( ENTITY_TUP_CTOR_SIG );↵
|
3 | if ( ! ReflectHelper.isPublic( ctor ) ) {↵ | | 3 | if ( ! ReflectHelper.isPublic( ctor ) ) {↵
|
4 | try {↵ | | 4 | try {↵
|
5 | // found a ctor, but it was not publicly accessible so try to request accessibility↵ | | 5 | // found a ctor, but it was not publicly accessible so try to request accessibility↵
|
6 | ctor.setAccessible( true );↵ | | 6 | ctor.setAccessible( true );↵
|
7 | }↵ | | 7 | }↵
|
8 | catch ( SecurityException e ) {↵ | | 8 | catch ( SecurityException e ) {↵
|
9 | ctor = null;↵ | | 9 | ctor = null;↵
|
10 | }↵ | | 10 | }↵
|
11 | }↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
13 | catch ( NoSuchMethodException ignore ) {↵ | | 13 | catch ( NoSuchMethodException ignore ) {↵
|
14 | } | | 14 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | try | | 2 | try |
3 | ctor = clazz.getDeclaredConstructor(COMPONENT_TUP_CTOR_SIG); | | 3 | ctor = clazz.getDeclaredConstructor(ENTITY_TUP_CTOR_SIG); |
4 | if (!ReflectHelper.isPublic(ctor)) | | 4 | if (!ReflectHelper.isPublic(ctor)) |
5 | | | 5 | |
6 | ctor.setAccessible(true); | | 6 | ctor.setAccessible(true); |
Precondition Violations (0)
Row |
Violation |