Iterator itr = files.iterator(); while ( itr.hasNext() ) { final File file = ( File ) itr.next(); processFile( file, classNames ); }
Iterator itr = files.iterator(); while ( itr.hasNext() ) { final File file = ( File ) itr.next(); collectClassNames( file, classNames ); }
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: 4 Number of AST nodes: 4
1
Iterator itr = files.iterator();
1
Iterator itr = files.iterator();
2
			while ( itr.hasNext() ) {
2
				while ( itr.hasNext() ) {
3
				final File file = ( File ) itr.next();
3
					final File file = ( File ) itr.next();
4
				processFile( file, classNames );
4
					collectClassNames( file, classNames );
5
			}
5
				}
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 comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    Iterator itr = files.iterator();
    5
    Iterator itr = files.iterator();
    12
    while (itr.hasNext())
    6
    while (itr.hasNext())
    13
    final File file = (File)itr.next();
    7
    final File file = (File)itr.next();
    14
    processFile(file, classNames);
    14
    processFile(file, classNames);
    8
    collectClassNames(file, classNames);
    Differences
    Expression1Expression2Difference
    processFilecollectClassNamesMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression processFile(file,classNames) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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) is a void method call, and thus it cannot be parameterized
    Expression collectClassNames(file,classNames) is a void method call, and thus it cannot be parameterized
    8
    collectClassNames(file, classNames);
    Precondition Violations (4)
    Row Violation
    1Expression processFile(file,classNames) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression collectClassNames(file,classNames) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression processFile(file,classNames) is a void method call, and thus it cannot be parameterized
    4Expression collectClassNames(file,classNames) is a void method call, and thus it cannot be parameterized