while ( iter.hasNext() ) { String[] lines = ( (PersistentIdentifierGenerator) iter.next() ).sqlDropStrings( dialect ); for ( int i = 0; i < lines.length ; i++ ) { script.add( lines[i] ); } }
for (int i = 0; i < list.size(); i++) { Element element = (Element) list.get(i); print(element); assertTrue(element.asXML().equals(expectedResults[i])); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/entitymode/dom4j/many2one/Dom4jManyToOneTest.java
Method name: String[] generateDropSchemaScript(Dialect) Method name: void testDom4jManyToOne()
Number of AST nodes: 4 Number of AST nodes: 4
1
while ( iter.hasNext() ) {
2
			String[] lines = ( (PersistentIdentifierGenerator) iter.next() ).sqlDropStrings( dialect 
1
for (int i = 0; i < list.size(); i++) {
3
);
2
			Element element = (Element) list.get(i);
4
			for ( int i = 0; i < lines.length ; i++ ) {
3
			
5
				script.add( line
4
print(element);
6
s[i] );
5
			assertTrue(element.asXML().equals(expectedResults[i]));
7
			}
6
		
8
		}
7
}
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.3
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)2.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    27
    String[] lines = ((PersistentIdentifierGenerator)iter.next()).sqlDropStrings(dialect);
    27
    String[] lines = ((PersistentIdentifierGenerator)iter.next()).sqlDropStrings(dialect);
    Preondition Violations
    Unmatched statement String[] lines=((PersistentIdentifierGenerator)iter.next()).sqlDropStrings(dialect); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                    
    28
    for (int i = 0; i < lines.length; i++)
    28
    for (int i = 0; i < lines.length; i++)
    21
    for (int i = 0; i < list.size(); i++)
    Differences
    Expression1Expression2Difference
    lines.lengthlist.size()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression lines.length cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21
    for (int i = 0; i < list.size(); i++)
                                                                                      
    22
    Element element = (Element)list.get(i);
    Preondition Violations
    Unmatched statement Element element=(Element)list.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    22
    Element element = (Element)list.get(i);
                                          
    23
    print(element);
    Preondition Violations
    Unmatched statement print(element); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    23
    print(element);
                                                                                                                          
    24
    assertTrue(element.asXML().equals(expectedResults[i]));
    Preondition Violations
    Unmatched statement assertTrue(element.asXML().equals(expectedResults[i])); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24
    assertTrue(element.asXML().equals(expectedResults[i]));
    29
    script.add(lines[i]);
    29
    script.add(lines[i]);
    Preondition Violations
    Unmatched statement script.add(lines[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                      
    Precondition Violations (7)
    Row Violation
    1Unmatched statement String[] lines=((PersistentIdentifierGenerator)iter.next()).sqlDropStrings(dialect); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression lines.length cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement Element element=(Element)list.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement print(element); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5Unmatched statement assertTrue(element.asXML().equals(expectedResults[i])); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement script.add(lines[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero