for(int i = 0; i < threads.length; i++) { threads[i].start(); }
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/util/WorkThreadPool.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/ActionSet.java
Method name: void start() Method name: void ActionSet(PluginJAR, String[], boolean[], URL)
Number of AST nodes: 2 Number of AST nodes: 3
1
for(int i = 0; i < threads.length; i++)
1
for(int i = 0; i < cachedActionNames.length; i++)
2
			{
2
			{
3
				threads[i].start(
3
				actions.put(cachedActionNames[i],placeholder);
4
				jEdit.setTemporaryProperty(cachedActionNames[i]
5
					+ ".toggle",cachedActionToggleFlags[i]
4
);
6
					? "true" : "false");
5
			}
7
			}
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 comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    6
    for (int i = 0; i < threads.length; i++)
    6
    for (int i = 0; i < threads.length; i++)
    5
    for (int i = 0; i < cachedActionNames.length; i++)
    Differences
    Expression1Expression2Difference
    threadscachedActionNamesVARIABLE_NAME_MISMATCH
    org.gjt.sp.util.WorkThread[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.util.WorkThread[] of variable threads does not match with type java.lang.String[] of variable cachedActionNames
    • Make classes org.gjt.sp.util.WorkThread[] 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");
    7
    threads[i].start();
    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
                                                
    Precondition Violations (4)
    Row Violation
    1Type org.gjt.sp.util.WorkThread[] of variable threads does not match with type java.lang.String[] of variable cachedActionNames
    2Unmatched 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
    3Unmatched 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
    4Unmatched statement threads[i].start(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted