if(1 < _framesInOpeningSequence.size()) { return _framesInOpeningSequence.get(0); } else { return sessionWindow; }
if(1 < _framesInOpeningSequence.size()) { return _framesInOpeningSequence.get(_framesInOpeningSequence.size() - 1); } else { return sessionWindow; }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/SessionWindowsHolder.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/SessionWindowsHolder.java
Method name: ISessionWidget getNextSessionWindow(ISessionWidget) Method name: ISessionWidget getPreviousSessionWindow(ISessionWidget)
Number of AST nodes: 3 Number of AST nodes: 3
1
if(1 < _framesInOpeningSequence.size())
1
if(1 < _framesInOpeningSequence.size())
2
         {
2
         {
3
            return _framesInOpeningSequence.get(0);
3
            return _framesInOpeningSequence.get(_framesInOpeningSequence.size() - 1);
4
         }
4
         }
5
         else
5
         else
6
         {
6
         {
7
            return sessionWindow;
7
            return sessionWindow;
8
         }
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 declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (1 < _framesInOpeningSequence.size())
    4
    if (1 < _framesInOpeningSequence.size())
    5
    return _framesInOpeningSequence.get(0);
    5
    return _framesInOpeningSequence.get(0);
    5
    return _framesInOpeningSequence.get(_framesInOpeningSequence.size() - 1);
    Differences
    Expression1Expression2Difference
    0_framesInOpeningSequence.size() - 1TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression _framesInOpeningSequence.size() - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    return _framesInOpeningSequence.get(_framesInOpeningSequence.size() - 1);
    else
    else
    6
    return sessionWindow;
    6
    return sessionWindow;
    Precondition Violations (2)
    Row Violation
    1Expression _framesInOpeningSequence.size() - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Not all possible execution flows end in a return statement