if(this.endOffsets.length <= lineCount) { int[] endOffsetsN = new int[(lineCount + 1) * 2]; System.arraycopy(this.endOffsets,0,endOffsetsN,0, this.endOffsets.length); this.endOffsets = endOffsetsN; }
if(lineInfo.length <= lineCount) { int[] lineInfoN = new int[(lineCount + 1) * 2]; System.arraycopy(lineInfo,0,lineInfoN,0, lineInfo.length); lineInfo = lineInfoN; }
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/org/gjt/sp/jedit/buffer/LineManager.java
Method name: void contentInserted(int, int, int, int, IntegerArray) Method name: void contentInserted(int, int, int, int, IntegerArray)
Number of AST nodes: 4 Number of AST nodes: 4
1
if(this.endOffsets.length <= lineCount)
1
if(lineInfo.length <= lineCount)
2
			{
2
			{
3
				int[] endOffsetsN = new int[(lineCount + 1) * 2];
3
				int[] lineInfoN = new int[(lineCount + 1) * 2];
4
				System.arraycopy(this.endOffsets,0,endOffsetsN,0,
4
				System.arraycopy(
5
						 this.endOffsets.length);
6
				this.endOffsets = endOffsets
5
lineInfo,0,lineInfoN,0,
6
						 lineInfo.length);
7
N;
7
				lineInfo = lineInfoN;
8
			}
8
			}
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 comparisons17
  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)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (this.endOffsets.length <= lineCount)
    5
    if (this.endOffsets.length <= lineCount)
    9
    if (lineInfo.length <= lineCount)
    Differences
    Expression1Expression2Difference
    this.endOffsets.lengthlineInfo.lengthTYPE_COMPATIBLE_REPLACEMENT
    9
    if (lineInfo.length <= lineCount)
    6
    int[] endOffsetsN = new int[(lineCount + 1) * 2];
    6
    int[] endOffsetsN = new int[(lineCount + 1) * 2];
    10
    int[] lineInfoN = new int[(lineCount + 1) * 2];
    Differences
    Expression1Expression2Difference
    endOffsetsNlineInfoNVARIABLE_NAME_MISMATCH
    10
    int[] lineInfoN = new int[(lineCount + 1) * 2];
    7
    System.arraycopy(this.endOffsets, 0, endOffsetsN, 0, this.endOffsets.length);
    7
    System.arraycopy(this.endOffsets, 0, endOffsetsN, 0, this.endOffsets.length);
    11
    System.arraycopy(lineInfo, 0, lineInfoN, 0, lineInfo.length);
    Differences
    Expression1Expression2Difference
    this.endOffsetslineInfoTYPE_COMPATIBLE_REPLACEMENT
    endOffsetsNlineInfoNVARIABLE_NAME_MISMATCH
    this.endOffsets.lengthlineInfo.lengthTYPE_COMPATIBLE_REPLACEMENT
    11
    System.arraycopy(lineInfo, 0, lineInfoN, 0, lineInfo.length);
    8
    this.endOffsets = endOffsetsN;
    8
    this.endOffsets = endOffsetsN;
    12
    lineInfo = lineInfoN;
    Differences
    Expression1Expression2Difference
    this.endOffsetslineInfoTYPE_COMPATIBLE_REPLACEMENT
    endOffsetsNlineInfoNVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.endOffsets is a field being modified, and thus it cannot be parameterized
    Expression lineInfo is a field being modified, and thus it cannot be parameterized
    12
    lineInfo = lineInfoN;
    Precondition Violations (2)
    Row Violation
    1Expression this.endOffsets is a field being modified, and thus it cannot be parameterized
    2Expression lineInfo is a field being modified, and thus it cannot be parameterized