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;
}
}
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;
}
}
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: 4
|
|
Number of AST nodes: 4
|
|
1 | ctor = clazz.getDeclaredConstructor( COMPONENT_TUP_CTOR_SIG );↵ | | 1 | ctor = clazz.getDeclaredConstructor( ENTITY_TUP_CTOR_SIG );↵
|
2 | if ( ! ReflectHelper.isPublic( ctor ) ) {↵ | | 2 | if ( ! ReflectHelper.isPublic( ctor ) ) {↵
|
3 | try {↵ | | 3 | try {↵
|
4 | // found a ctor, but it was not publicly accessible so try to request accessibility↵ | | 4 | // found a ctor, but it was not publicly accessible so try to request accessibility↵
|
5 | ctor.setAccessible( true );↵ | | 5 | ctor.setAccessible( true );↵
|
6 | }↵ | | 6 | }↵
|
7 | catch ( SecurityException e ) {↵ | | 7 | catch ( SecurityException e ) {↵
|
8 | ctor = null;↵ | | 8 | ctor = null;↵
|
9 | }↵ | | 9 | }↵
|
10 | } | | 10 | }
|
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 7 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
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 |