if(toCheck == STOP_AT[i]) { return true; }
for (int i = 0; i < editableColumns.length; i++) { if (colIdx == editableColumns[i]) { return true; } }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/KeyManager.java File path: /sql12/test/src/net/sourceforge/squirrel_sql/client/update/gui/AbstractTableModelTest.java
Method name: boolean isInStopAtArray(char) Method name: boolean isEditableColumn(int)
Number of AST nodes: 2 Number of AST nodes: 3
1
if(toCheck == STOP_AT[i])
2
         {
3
            
1
for (int i = 0; i < editableColumns.length; i++) {
2
   		if (colIdx == editableColumns[i]) {
4
return true;
3
   			return true;
5
      
4
   		}
6
   }
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.2
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (toCheck == STOP_AT[i])
    2
    if (toCheck == STOP_AT[i])
    2
    if (colIdx == editableColumns[i])
    Differences
    Expression1Expression2Difference
    toCheckcolIdxVARIABLE_NAME_MISMATCH
    charintVARIABLE_TYPE_MISMATCH
    STOP_ATeditableColumnsVARIABLE_NAME_MISMATCH
    char[]int[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type char of variable toCheck does not match with type int of variable colIdx
    Type char[] of variable STOP_AT does not match with type int[] of variable editableColumns
    • Make classes char[] and int[] extend a common superclass
    2
    if (colIdx == editableColumns[i])
    3
    return true;
    3
    return true;
    Precondition Violations (3)
    Row Violation
    1Type char of variable toCheck does not match with type int of variable colIdx
    2Type char[] of variable STOP_AT does not match with type int[] of variable editableColumns
    3Not all possible execution flows end in a return statement