for (int i = 0; i < s.length; i++) { addSession(s[i]); }
for (int i = 0; i < _executionListeners.length; i++) { _executionListeners[i].statementExecuted(sql); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/mainframe/MainFrameToolBar.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/SQLExecuterTask.java
Method name: void load() Method name: void run()
Number of AST nodes: 2 Number of AST nodes: 2
1
for (int i = 0; i < s.length; i++)
1
for (int i = 0; i < 
2
				{
3
					addSession(s[i]);
4
				
2
_executionListeners.length; i++)
3
            {
4
               _executionListeners[i].statementExecuted(sql);
5
}
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 comparisons4
  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)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (int i = 0; i < s.length; i++)
    3
    for (int i = 0; i < s.length; i++)
    1
    for (int i = 0; i < _executionListeners.length; i++)
    Differences
    Expression1Expression2Difference
    s_executionListenersVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.session.ISession[]net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable s.length does not match with type int of variable _executionListeners.length
    • Make classes net.sourceforge.squirrel_sql.client.session.ISession[] and net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener[] extend a common superclass
    1
    for (int i = 0; i < _executionListeners.length; i++)
    4
    addSession(s[i]);
    4
    addSession(s[i]);
    2
    _executionListeners[i].statementExecuted(sql);
    Differences
    Expression1Expression2Difference
    s[i]sqlAST_TYPE_MISMATCH
    addSessionstatementExecutedMETHOD_INVOCATION_NAME_MISMATCH
    _executionListeners[i]MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression s[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addSession(s[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method addSession
    Expression _executionListeners[i].statementExecuted(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addSession(s[i]) is a void method call, and thus it cannot be parameterized
    Expression _executionListeners[i].statementExecuted(sql) is a void method call, and thus it cannot be parameterized
    Expression addSession(s[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method addSession
    Expression _executionListeners[i].statementExecuted(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addSession(s[i]) is a void method call, and thus it cannot be parameterized
    Expression _executionListeners[i].statementExecuted(sql) is a void method call, and thus it cannot be parameterized
    2
    _executionListeners[i].statementExecuted(sql);
    Precondition Violations (11)
    Row Violation
    1Type int of variable s.length does not match with type int of variable _executionListeners.length
    2Expression s[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression addSession(s[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression _executionListeners[i].statementExecuted(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression addSession(s[i]) is a void method call, and thus it cannot be parameterized
    6Expression _executionListeners[i].statementExecuted(sql) is a void method call, and thus it cannot be parameterized
    7Expression addSession(s[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression _executionListeners[i].statementExecuted(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression addSession(s[i]) is a void method call, and thus it cannot be parameterized
    10Expression _executionListeners[i].statementExecuted(sql) is a void method call, and thus it cannot be parameterized
    11The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameToolBar.SessionDropDownModel and do not have a common superclass