for (int i = 0; i < s.length; i++) { addSession(s[i]); }
if (expPartLenth != -1) { for (int i = 0; i < parts.length; i++) { assertEquals("length of parts["+i+"]", expPartLenth , parts[0].length()); } }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/mainframe/MainFrameToolBar.java File path: /sql12/test/src/net/sourceforge/squirrel_sql/fw/gui/GUIUtilsTest.java
Method name: void load() Method name: void assertEquality(String, int, int, int)
Number of AST nodes: 2 Number of AST nodes: 3
1
if (expPartLenth != -1) {
1
for (int i = 0; i < s.length; i++)
2
            for (int i = 0; i < parts.length; i++)
2
				{
3
					addSession(s[i]);
4
				
3
 {
4
                assertEquals("length of parts["+i+"]", 
5
                             expPartLenth , 
6
                             parts[0].length());
7
            }
5
}
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.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)1.4
    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++)
    5
    for (int i = 0; i < parts.length; i++)
    Differences
    Expression1Expression2Difference
    spartsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.session.ISession[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable s.length does not match with type int of variable parts.length
    • Make classes net.sourceforge.squirrel_sql.client.session.ISession[] and java.lang.String[] extend a common superclass
    5
    for (int i = 0; i < parts.length; i++)
    4
    addSession(s[i]);
    4
    addSession(s[i]);
    6
    assertEquals("length of parts[" + i + "]", expPartLenth, parts[0].length());
    Differences
    Expression1Expression2Difference
    addSessionassertEqualsMETHOD_INVOCATION_NAME_MISMATCH
    addSession(s[i])assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length())TYPE_COMPATIBLE_REPLACEMENT
    addSession(s[i])assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression addSession(s[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method addSession
    Expression assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length()) 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 assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length()) 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 assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length()) 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 assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length()) is a void method call, and thus it cannot be parameterized
    6
    assertEquals("length of parts[" + i + "]", expPartLenth, parts[0].length());
    Precondition Violations (10)
    Row Violation
    1Type int of variable s.length does not match with type int of variable parts.length
    2Expression addSession(s[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression addSession(s[i]) is a void method call, and thus it cannot be parameterized
    5Expression assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length()) is a void method call, and thus it cannot be parameterized
    6Expression addSession(s[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression addSession(s[i]) is a void method call, and thus it cannot be parameterized
    9Expression assertEquals("length of parts[" + i + "]",expPartLenth,parts[0].length()) is a void method call, and thus it cannot be parameterized
    10The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameToolBar.SessionDropDownModel and net.sourceforge.squirrel_sql.fw.gui.GUIUtilsTest do not have a common superclass