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
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    3
    ctor = clazz.getDeclaredConstructor(COMPONENT_TUP_CTOR_SIG);
    3
    ctor = clazz.getDeclaredConstructor(COMPONENT_TUP_CTOR_SIG);
    3
    ctor = clazz.getDeclaredConstructor(ENTITY_TUP_CTOR_SIG);
    Differences
    Expression1Expression2Difference
    COMPONENT_TUP_CTOR_SIGENTITY_TUP_CTOR_SIGVARIABLE_NAME_MISMATCH
    3
    ctor = clazz.getDeclaredConstructor(ENTITY_TUP_CTOR_SIG);
    4
    if (!ReflectHelper.isPublic(ctor))
    4
    if (!ReflectHelper.isPublic(ctor))
    5
    try
    5
    try
    6
    ctor.setAccessible(true);
    6
    ctor.setAccessible(true);
    Precondition Violations (0)
    Row Violation