if(controllers[i].getTitle().equals(name + "_" + postfix)) { ++postfix; incremented = true; }
if(controllers[i].getTitle().equals(name)) { ++postfix; incremented = true; }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/GraphPlugin.java File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/GraphPlugin.java
Method name: String patchName(String, ISession) Method name: String patchName(String, ISession)
Number of AST nodes: 3 Number of AST nodes: 3
1
if(controllers[i].getTitle().equals(name + "_" + postfix))
1
if(controllers[i].getTitle().equals(name))
2
               {
2
               {
3
                  ++postfix;
3
                  ++postfix;
4
                  incremented = true;
4
                  incremented = true;
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 the same method
Number of node comparisons13
  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)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    if (controllers[i].getTitle().equals(name + "_" + postfix))
    14
    if (controllers[i].getTitle().equals(name + "_" + postfix))
    11
    if (controllers[i].getTitle().equals(name))
    Differences
    Expression1Expression2Difference
    name + "_" + postfixnameTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression name + "_" + postfix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    if (controllers[i].getTitle().equals(name))
    15
    ++postfix;
    12
    ++postfix;
    16
    incremented = true;
    13
    incremented = true;
    Precondition Violations (2)
    Row Violation
    1Expression name + "_" + postfix cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Clone fragment #1 returns variables postfix, incremented , while Clone fragment #2 returns variables postfix, incremented