Constructor ctor = null; 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 ) { } return ctor;
Constructor ctor = null; 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 ) { } return ctor;
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: 7 Number of AST nodes: 7
1
Constructor ctor = null;
1
Constructor ctor = null;
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
				try {
5
				try {
6
					// found a ctor, but it was not publicly accessible so try to request accessibility
6
					// found a ctor, but it was not publicly accessible so try to request accessibility
7
					ctor.setAccessible( true );
7
					ctor.setAccessible( true );
8
				}
8
				}
9
				catch ( SecurityException e ) {
9
				catch ( SecurityException e ) {
10
					ctor = null;
10
					ctor = null;
11
				}
11
				}
12
			}
12
			}
13
		}
13
		}
14
		catch ( NoSuchMethodException ignore ) {
14
		catch ( NoSuchMethodException ignore ) {
15
		}
15
		}
16
		return ctor;
16
		return ctor;
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.3
Clones locationClones are in different classes
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Constructor ctor = null;
    1
    Constructor ctor = null;
    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);
    7
    return ctor;
    7
    return ctor;
    Precondition Violations (0)
    Row Violation