EditPane[] panes = _view.getEditPanes(); for(int i = 0; i < panes.length; i++) { panes[i].saveCaretInfo(); } _view = _view.next;
for(int i = 0; i < cachedActionNames.length; i++) { actions.put(cachedActionNames[i],placeholder); jEdit.setTemporaryProperty(cachedActionNames[i] + ".toggle",cachedActionToggleFlags[i] ? "true" : "false"); }
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/jedit/ActionSet.java
Method name: void reloadAllBuffers(View, boolean) Method name: void ActionSet(PluginJAR, String[], boolean[], URL)
Number of AST nodes: 4 Number of AST nodes: 3
1
EditPane[] panes = _view.getEditPanes();
2
			for(int i = 0; i < panes.length; i++)
1
for(int i = 0; i < cachedActionNames.length; i++)
3
			{
2
			{
4
				panes[i].saveCaretInfo();
3
				
5
			}
6
			_view = _view.next;
4
actions.put(cachedActionNames[i],placeholder);
5
				jEdit.setTemporaryProperty(cachedActionNames[i]
6
					+ ".toggle",cachedActionToggleFlags[i]
7
					? "true" : "false");
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.3
Clones locationClones are in different classes
Number of node comparisons8
  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 fragment2
    Time elapsed for statement mapping (ms)0.9
    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++)
    5
    for (int i = 0; i < cachedActionNames.length; i++)
    Differences
    Expression1Expression2Difference
    panescachedActionNamesVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.EditPane[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.EditPane[] of variable panes does not match with type java.lang.String[] of variable cachedActionNames
    • Make classes org.gjt.sp.jedit.EditPane[] and java.lang.String[] extend a common superclass
    5
    for (int i = 0; i < cachedActionNames.length; i++)
                                                                                                      
    6
    actions.put(cachedActionNames[i], placeholder);
    Preondition Violations
    Unmatched statement actions.put(cachedActionNames[i],placeholder); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    actions.put(cachedActionNames[i], placeholder);
                                                                                                                                                                                                                                
    7
    jEdit.setTemporaryProperty(cachedActionNames[i] + ".toggle", cachedActionToggleFlags[i] ? "true" : "false");
    Preondition Violations
    Unmatched statement jEdit.setTemporaryProperty(cachedActionNames[i] + ".toggle",cachedActionToggleFlags[i] ? "true" : "false"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    jEdit.setTemporaryProperty(cachedActionNames[i] + ".toggle", cachedActionToggleFlags[i] ? "true" : "false");
    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 (5)
    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 java.lang.String[] of variable cachedActionNames
    3Unmatched statement actions.put(cachedActionNames[i],placeholder); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement jEdit.setTemporaryProperty(cachedActionNames[i] + ".toggle",cachedActionToggleFlags[i] ? "true" : "false"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement panes[i].saveCaretInfo(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted