Insert ins = new Insert(this,offset,length,text); if(clearDirty) { redoClearDirty = last; undoClearDirty = ins; } if(compoundEdit != null) compoundEdit.add(ins); else addEdit(ins);
Remove rem = new Remove(this,offset,length,text); if(clearDirty) { redoClearDirty = last; undoClearDirty = rem; } if(compoundEdit != null) compoundEdit.add(rem); else addEdit(rem);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/UndoManager.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/UndoManager.java
Method name: void contentInserted(int, int, String, boolean) Method name: void contentRemoved(int, int, String, boolean)
Number of AST nodes: 7 Number of AST nodes: 7
1
Insert ins = new Insert(this,offset,length,text);
1
Remove rem = new Remove(this,offset,length,text);
2
		if(clearDirty)
2
		if(clearDirty)
3
		{
3
		{
4
			redoClearDirty = last;
4
			redoClearDirty = last;
5
			undoClearDirty = ins;
5
			undoClearDirty = rem;
6
		}
6
		}
7
		if(compoundEdit != null)
7
		if(compoundEdit != null)
8
			compoundEdit.add(ins);
8
			compoundEdit.add(rem);
9
		else
9
		else
10
			addEdit(ins);
10
			addEdit(rem);
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 declared in the same class
Number of node comparisons29
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    Insert ins = new Insert(this, offset, length, text);
    13
    Insert ins = new Insert(this, offset, length, text);
    18
    Remove rem = new Remove(this, offset, length, text);
    Differences
    Expression1Expression2Difference
    org.gjt.sp.jedit.buffer.UndoManager.Insertorg.gjt.sp.jedit.buffer.UndoManager.RemoveSUBCLASS_TYPE_MISMATCH
    insremVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.buffer.UndoManager.Insertorg.gjt.sp.jedit.buffer.UndoManager.RemoveSUBCLASS_TYPE_MISMATCH
    org.gjt.sp.jedit.buffer.UndoManager.Insertorg.gjt.sp.jedit.buffer.UndoManager.RemoveSUBCLASS_TYPE_MISMATCH
    18
    Remove rem = new Remove(this, offset, length, text);
    14
    if (clearDirty)
    19
    if (clearDirty)
    15
    redoClearDirty = last;
    20
    redoClearDirty = last;
    16
    undoClearDirty = ins;
    16
    undoClearDirty = ins;
    21
    undoClearDirty = rem;
    Differences
    Expression1Expression2Difference
    insremVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.buffer.UndoManager.Insertorg.gjt.sp.jedit.buffer.UndoManager.RemoveSUBCLASS_TYPE_MISMATCH
    21
    undoClearDirty = rem;
    17
    if (compoundEdit != null)
    22
    if (compoundEdit != null)
    18
    compoundEdit.add(ins);
    18
    compoundEdit.add(ins);
    23
    compoundEdit.add(rem);
    Differences
    Expression1Expression2Difference
    insremVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.buffer.UndoManager.Insertorg.gjt.sp.jedit.buffer.UndoManager.RemoveSUBCLASS_TYPE_MISMATCH
    23
    compoundEdit.add(rem);
    else
    else
    19
    addEdit(ins);
    19
    addEdit(ins);
    24
    addEdit(rem);
    Differences
    Expression1Expression2Difference
    insremVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.buffer.UndoManager.Insertorg.gjt.sp.jedit.buffer.UndoManager.RemoveSUBCLASS_TYPE_MISMATCH
    24
    addEdit(rem);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables , while Clone fragment #2 returns variables rem