EditPane[] panes = _view.getEditPanes(); for(int i = 0; i < panes.length; i++) { panes[i].saveCaretInfo(); } _view = _view.next;
for(int i = 0; i < threads.length; i++) { threads[i].start(); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/jEdit.java File path: /jEdit-4.2/src/org/gjt/sp/util/WorkThreadPool.java
Method name: void reloadAllBuffers(View, boolean) Method name: void start()
Number of AST nodes: 4 Number of AST nodes: 2
1
EditPane[] panes = _view.getEditPanes();
2
			for(int i = 0; i < panes.length; i++)
1
for(int i = 0; i < threads.length; i++)
3
			{
2
			{
4
				panes[i].saveCaretInfo();
3
				threads[i].s
5
			}
6
			_view = _view.next;
4
tart();
5
			}
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 in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)81.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    11
    EditPane[] panes = _view.getEditPanes();
    11
    EditPane[] panes = _view.getEditPanes();
    Preondition Violations
    Unmatched statement EditPane[] panes=_view.getEditPanes(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                        
    12
    for (int i = 0; i < panes.length; i++)
    12
    for (int i = 0; i < panes.length; i++)
    6
    for (int i = 0; i < threads.length; i++)
    Differences
    Expression1Expression2Difference
    panesthreadsVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.EditPane[]org.gjt.sp.util.WorkThread[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.EditPane[] of variable panes does not match with type org.gjt.sp.util.WorkThread[] of variable threads
    • Make classes org.gjt.sp.jedit.EditPane[] and org.gjt.sp.util.WorkThread[] extend a common superclass
    6
    for (int i = 0; i < threads.length; i++)
                                                
    7
    threads[i].start();
    Preondition Violations
    Unmatched statement threads[i].start(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    threads[i].start();
    13
    panes[i].saveCaretInfo();
    13
    panes[i].saveCaretInfo();
    Preondition Violations
    Unmatched statement panes[i].saveCaretInfo(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                              
    14
    _view = _view.next;
                                              
    Precondition Violations (4)
    Row Violation
    1Unmatched statement EditPane[] panes=_view.getEditPanes(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type org.gjt.sp.jedit.EditPane[] of variable panes does not match with type org.gjt.sp.util.WorkThread[] of variable threads
    3Unmatched statement threads[i].start(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement panes[i].saveCaretInfo(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted