if(offset >= fieldAreas[i][FA_START] && offset <= fieldAreas[i][FA_END]) { SQLColumn col = new SQLColumn(this, offset, offset); col.setRepeatable(false); return col; }
if(position >= updateListStart && position <= updateListEnd) { SQLColumn col = new SQLColumn(this, position); col.setRepeatable(false); return col; }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/parser/kernel/completions/SQLSelectStatement.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/parser/kernel/completions/SQLModifyingStatement.java
Method name: Completion getCompletion(int) Method name: Completion getCompletion(int)
Number of AST nodes: 4 Number of AST nodes: 4
1
if(offset >= fieldAreas[i][FA_START] && offset <= fieldAreas[i][FA_END]) {
1
if(
2
    
2
position >= updateListStart && position <= updateListEnd) {
3
                SQLColumn col = new SQLColumn(this, offset, offset);
3
                SQLColumn col = new SQLColumn(this, 
4
    
4
position);
5
                col.setRepeatable(false);
5
                col.setRepeatable(false);
6
                    return col;
6
                return col;
7
                }
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 having the same super class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    if (offset >= fieldAreas[i][FA_START] && offset <= fieldAreas[i][FA_END])
    9
    if (offset >= fieldAreas[i][FA_START] && offset <= fieldAreas[i][FA_END])
    3
    if (position >= updateListStart && position <= updateListEnd)
    Differences
    Expression1Expression2Difference
    offsetpositionVARIABLE_NAME_MISMATCH
    fieldAreas[i][FA_START]updateListStartTYPE_COMPATIBLE_REPLACEMENT
    offsetpositionVARIABLE_NAME_MISMATCH
    fieldAreas[i][FA_END]updateListEndTYPE_COMPATIBLE_REPLACEMENT
    3
    if (position >= updateListStart && position <= updateListEnd)
    10
    SQLColumn col = new SQLColumn(this, offset, offset);
    10
    SQLColumn col = new SQLColumn(this, offset, offset);
    4
    SQLColumn col = new SQLColumn(this, position);
    Differences
    Expression1Expression2Difference
    new SQLColumn(this,offset,offset)new SQLColumn(this,position)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new SQLColumn(this,offset,offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new SQLColumn(this,position) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    SQLColumn col = new SQLColumn(this, position);
    11
    col.setRepeatable(false);
    5
    col.setRepeatable(false);
    12
    return col;
    6
    return col;
    Precondition Violations (3)
    Row Violation
    1Expression new SQLColumn(this,offset,offset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new SQLColumn(this,position) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Not all possible execution flows end in a return statement