if(gapWidth != 0) { if(Debug.OFFSET_DEBUG && gapLine != newGapLine) Log.log(Log.DEBUG,this,method + ": update from " + gapLine + " to " + newGapLine + " width " + gapWidth); for(int i = gapLine; i < newGapLine; i++) setLineEndOffset(i,getLineEndOffset(i)); } gapWidth += newGapWidth;
if(gapWidth != 0) { if(Debug.OFFSET_DEBUG && newGapLine != gapLine) Log.log(Log.DEBUG,this,method + ": update from " + newGapLine + " to " + gapLine + " width " + gapWidth); for(int i = newGapLine; i < gapLine; i++) setLineEndOffset(i,getLineEndOffset(i) - gapWidth); } gapWidth += newGapWidth;
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 moveGap(int, int, String) Method name: void moveGap(int, int, String)
Number of AST nodes: 6 Number of AST nodes: 6
1
if(gapWidth != 0)
1
if(gapWidth != 0)
2
			{
2
			{
3
				if(Debug.OFFSET_DEBUG && gapLine != newGapLine)
3
				if(Debug.OFFSET_DEBUG && newGapLine != gapLine)
4
					Log.log(Log.DEBUG,this,method + ": update from " + gapLine + " to " + newGapLine + " width " + gapWidth);
4
					Log.log(Log.DEBUG,this,method + ": update from " + newGapLine + " to " + gapLine + " width " + gapWidth);
5
				for(int i = gapLine; i < newGapLine; i++)
5
				for(int i = newGapLine; i < gapLine; i++)
6
					setLineEndOffset(i,getLineEndOffset(i));
6
					setLineEndOffset(i,getLineEndOffset(i) - gapWidth);
7
			}
7
			}
8
			gapWidth += newGapWidth;
8
			gapWidth += newGapWidth;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in the same method
Number of node comparisons12
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    17
    if (gapWidth != 0)
    11
    if (gapWidth != 0)
    18
    if (Debug.OFFSET_DEBUG && gapLine != newGapLine)
    18
    if (Debug.OFFSET_DEBUG && gapLine != newGapLine)
    12
    if (Debug.OFFSET_DEBUG && newGapLine != gapLine)
    Differences
    Expression1Expression2Difference
    gapLinenewGapLineVARIABLE_NAME_MISMATCH
    newGapLinegapLineVARIABLE_NAME_MISMATCH
    12
    if (Debug.OFFSET_DEBUG && newGapLine != gapLine)
    19
    Log.log(Log.DEBUG, this, method + ": update from " + gapLine + " to " + newGapLine + " width " + gapWidth);
    19
    Log.log(Log.DEBUG, this, method + ": update from " + gapLine + " to " + newGapLine + " width " + gapWidth);
    13
    Log.log(Log.DEBUG, this, method + ": update from " + newGapLine + " to " + gapLine + " width " + gapWidth);
    Differences
    Expression1Expression2Difference
    gapLinenewGapLineVARIABLE_NAME_MISMATCH
    newGapLinegapLineVARIABLE_NAME_MISMATCH
    13
    Log.log(Log.DEBUG, this, method + ": update from " + newGapLine + " to " + gapLine + " width " + gapWidth);
    20
    for (int i = gapLine; i < newGapLine; i++)
    20
    for (int i = gapLine; i < newGapLine; i++)
    14
    for (int i = newGapLine; i < gapLine; i++)
    Differences
    Expression1Expression2Difference
    gapLinenewGapLineVARIABLE_NAME_MISMATCH
    newGapLinegapLineVARIABLE_NAME_MISMATCH
    14
    for (int i = newGapLine; i < gapLine; i++)
    21
    setLineEndOffset(i, getLineEndOffset(i));
    21
    setLineEndOffset(i, getLineEndOffset(i));
    15
    setLineEndOffset(i, getLineEndOffset(i) - gapWidth);
    Differences
    Expression1Expression2Difference
    getLineEndOffset(i)getLineEndOffset(i) - gapWidthTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression getLineEndOffset(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getLineEndOffset(i) - gapWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15
    setLineEndOffset(i, getLineEndOffset(i) - gapWidth);
    22
    gapWidth += newGapWidth;
    16
    gapWidth += newGapWidth;
    Precondition Violations (2)
    Row Violation
    1Expression getLineEndOffset(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getLineEndOffset(i) - gapWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted