for ( int dp_indx = 0; dp_indx < nestedDataPointCount; dp_indx++ ) { DataPoint dp = new DataPoint(); dp.setDescription( "data-point [" + c_indx + ", " + dp_indx + "]" ); // more HSQLDB fun... // dp.setX( new BigDecimal( c_indx ) ); dp.setX( new BigDecimal( c_indx + dp_indx ) ); dp.setY( new BigDecimal( dp_indx ) ); container.getDataPoints().add( dp ); }
Parent p = new Parent( String.valueOf( i + 100 ) ); Child child = new Child( "child" + i ); child.setParent( p ); p.getChildren().add( child ); s.save( p ); parents.add(p);
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/proxy/ProxyTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/reattachment/ProxyReattachmentTest.java
Method name: void testFullyLoadedPCSerialization() Method name: void testIterateWithEvictTopOfLoop()
Number of AST nodes: 6 Number of AST nodes: 6
1
for ( int dp_indx = 0; dp_indx < nestedDataPointCount; dp_indx++ ) {
2
				DataPoint dp = new DataPoint();
3
				dp.setDescription( "data-point [" + c_indx + ", " + dp_indx + "]" );
4
// more HSQLDB fun...
5
//				dp.setX( new BigDecimal( c_indx )
1
Parent p = new Parent( String.valueOf( i + 100 ) );
2
			Child child = new Child( "child" + i );
6
 );
3
			child.setParent( p );
7
				dp.setX( new BigDecimal( c_indx + dp_indx ) );
4
			p.getChildren().add( child );
8
				dp.setY( new BigDecimal( dp_indx ) );
5
			s.save( p );
9
				container.getDataPoints().add( dp );
6
			parents.add(
10
			}
7
p);
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    11
    DataPoint dp = new DataPoint();
    11
    DataPoint dp = new DataPoint();
    5
    Parent p = new Parent(String.valueOf(i + 100));
    Differences
    Expression1Expression2Difference
    dppVARIABLE_NAME_MISMATCH
    new DataPoint()new Parent(String.valueOf(i + 100))ARGUMENT_NUMBER_MISMATCH
    5
    Parent p = new Parent(String.valueOf(i + 100));
                                                                                
    6
    Child child = new Child("child" + i);
                                                
    7
    child.setParent(p);
    Preondition Violations
    Unmatched statement child.setParent(p); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    child.setParent(p);
                                                                
    8
    p.getChildren().add(child);
    Preondition Violations
    Unmatched statement p.getChildren().add(child); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    p.getChildren().add(child);
                              
    9
    s.save(p);
    Preondition Violations
    Unmatched statement s.save(p); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    s.save(p);
    12
    dp.setDescription("data-point [" + c_indx + ", " + dp_indx + "]");
    12
    dp.setDescription("data-point [" + c_indx + ", " + dp_indx + "]");
    Preondition Violations
    Unmatched statement dp.setDescription("data-point [" + c_indx + ", "+ dp_indx+ "]"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                            
    13
    dp.setX(new BigDecimal(c_indx + dp_indx));
    13
    dp.setX(new BigDecimal(c_indx + dp_indx));
    Preondition Violations
    Unmatched statement dp.setX(new BigDecimal(c_indx + dp_indx)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    14
    dp.setY(new BigDecimal(dp_indx));
    14
    dp.setY(new BigDecimal(dp_indx));
    Preondition Violations
    Unmatched statement dp.setY(new BigDecimal(dp_indx)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                              
    15
    container.getDataPoints().add(dp);
    15
    container.getDataPoints().add(dp);
    10
    parents.add(p);
    Differences
    Expression1Expression2Difference
    dppVARIABLE_NAME_MISMATCH
    container.getDataPoints()parentsTYPE_COMPATIBLE_REPLACEMENT
    10
    parents.add(p);
    Precondition Violations (7)
    Row Violation
    1Unmatched statement child.setParent(p); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement p.getChildren().add(child); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement s.save(p); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement dp.setDescription("data-point [" + c_indx + ", "+ dp_indx+ "]"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement dp.setX(new BigDecimal(c_indx + dp_indx)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement dp.setY(new BigDecimal(dp_indx)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Clone fragment #1 returns variable dp with type org.hibernate.test.proxy.DataPoint , while Clone fragment #2 returns variable p with type org.hibernate.test.reattachment.Parent