for(int i = 0; i < threads.length; i++) { threads[i].start(); }
dout.writeInt(bools.length); for(int i = 0; i < bools.length; i++) { dout.writeBoolean(bools[i]); }
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/PluginJAR.java
Method name: void start() Method name: void writeBooleanArray(DataOutputStream, boolean[])
Number of AST nodes: 2 Number of AST nodes: 3
1
dout.writeInt(bools.length);
1
for(int i = 0; i < threads.length; i++)
2
				for(int i = 0; i < bools.length; i++)
2
			{
3
				{
3
				threads[i].start();
4
					dout.writeBoolean(bools[i]);
4
			}
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 comparisons4
  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
                                                                  
    3
    dout.writeInt(bools.length);
    6
    for (int i = 0; i < threads.length; i++)
    6
    for (int i = 0; i < threads.length; i++)
    4
    for (int i = 0; i < bools.length; i++)
    Differences
    Expression1Expression2Difference
    threadsboolsVARIABLE_NAME_MISMATCH
    org.gjt.sp.util.WorkThread[]boolean[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.util.WorkThread[] of variable threads does not match with type boolean[] of variable bools
    • Make classes org.gjt.sp.util.WorkThread[] and boolean[] extend a common superclass
    4
    for (int i = 0; i < bools.length; i++)
                                                                  
    5
    dout.writeBoolean(bools[i]);
    Preondition Violations
    Unmatched statement dout.writeBoolean(bools[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    dout.writeBoolean(bools[i]);
    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 (3)
    Row Violation
    1Type org.gjt.sp.util.WorkThread[] of variable threads does not match with type boolean[] of variable bools
    2Unmatched statement dout.writeBoolean(bools[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    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