int[] lineInfoN = new int[(lineCount + 1) * 2]; System.arraycopy(lineInfo,0,lineInfoN,0, lineInfo.length); lineInfo = lineInfoN;
Node c[] = new Node[i + 1]; System.arraycopy(children, 0, c, 0, children.length); children = c;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/LineManager.java File path: /jEdit-4.2/src/bsh/SimpleNode.java
Method name: void contentInserted(int, int, int, int, IntegerArray) Method name: void jjtAddChild(Node, int)
Number of AST nodes: 3 Number of AST nodes: 3
1
int[] lineInfoN = new int[(lineCount + 1) * 2];
2
				System.arraycopy(lineInfo,0,lineInfoN,0,
3
						 lineInfo.length);
4
				lineInfo = lineInfoN
1
Node c[] = new Node[i + 1];
2
				System.arraycopy(children, 0, c, 0, children.length);
5
;
3
				children = c;
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
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 fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                            
    4
    Node c[] = new Node[i + 1];
    10
    int[] lineInfoN = new int[(lineCount + 1) * 2];
                                                                                                      
    11
    System.arraycopy(lineInfo, 0, lineInfoN, 0, lineInfo.length);
    11
    System.arraycopy(lineInfo, 0, lineInfoN, 0, lineInfo.length);
    5
    System.arraycopy(children, 0, c, 0, children.length);
    Differences
    Expression1Expression2Difference
    lineInfochildrenVARIABLE_NAME_MISMATCH
    int[]bsh.Node[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int[] of variable lineInfo does not match with type bsh.Node[] of variable children
    • Make classes int[] and bsh.Node[] extend a common superclass
    5
    System.arraycopy(children, 0, c, 0, children.length);
                                
    6
    children = c;
    12
    lineInfo = lineInfoN;
                                                  
    Precondition Violations (1)
    Row Violation
    1Type int[] of variable lineInfo does not match with type bsh.Node[] of variable children