try { Iterator itr = files.iterator(); while ( itr.hasNext() ) { final File file = ( File ) itr.next(); collectClassNames( file, classNames ); } } catch ( ExecutionException ee ) { throw ee; } catch ( Exception e ) { throw new ExecutionException( e ); }
try { Iterator itr = files.iterator(); while ( itr.hasNext() ) { final File file = ( File ) itr.next(); processFile( file, classNames ); } } catch ( ExecutionException ee ) { throw ee; } catch ( Exception e ) { throw new ExecutionException( e ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/buildtime/AbstractInstrumenter.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/buildtime/AbstractInstrumenter.java
Method name: void execute(Set) Method name: void execute(Set)
Number of AST nodes: 5 Number of AST nodes: 5
1
try {
1
try {
2
				Iterator itr = files.iterator();
2
			Iterator itr = files.iterator();
3
				while ( itr.hasNext() ) {
3
			while ( itr.hasNext() ) {
4
					final File file = ( File ) itr.next();
4
				final File file = ( File ) itr.next();
5
					collectClassNames( file, classNames );
5
				processFile( file, classNames );
6
				}
6
			}
7
			}
7
		}
8
			catch ( ExecutionException ee ) {
8
		catch ( ExecutionException ee ) {
9
				throw ee;
9
			throw ee;
10
			}
10
		}
11
			catch ( Exception e ) {
11
		catch ( Exception e ) {
12
				throw new ExecutionException( e );
12
			throw new ExecutionException( e );
13
			}
13
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons13
  1. {Non-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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    try
    10
    try
    5
    Iterator itr = files.iterator();
    11
    Iterator itr = files.iterator();
    6
    while (itr.hasNext())
    12
    while (itr.hasNext())
    7
    final File file = (File)itr.next();
    13
    final File file = (File)itr.next();
    8
    collectClassNames(file, classNames);
    8
    collectClassNames(file, classNames);
    14
    processFile(file, classNames);
    Differences
    Expression1Expression2Difference
    collectClassNamesprocessFileMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression collectClassNames(file,classNames) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method collectClassNames
    Expression processFile(file,classNames) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collectClassNames(file,classNames) is a void method call, and thus it cannot be parameterized
    Expression processFile(file,classNames) is a void method call, and thus it cannot be parameterized
    14
    processFile(file, classNames);
    Precondition Violations (4)
    Row Violation
    1Expression collectClassNames(file,classNames) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression processFile(file,classNames) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression collectClassNames(file,classNames) is a void method call, and thus it cannot be parameterized
    4Expression processFile(file,classNames) is a void method call, and thus it cannot be parameterized