if (currentLoc.equals(base + "\\prim-key-class")) { currentEjb.setPrimaryKey(value); } else if (currentLoc.equals(base + "\\session-type")) { currentEjb.setBeantype(value); } else if (currentLoc.equals(base + "\\persistence-type")) { currentEjb.setCmp(value); }
if (currentLoc.equals(base + "\\iiop")) { currentEjb.setIiop(value); } else if (currentLoc.equals(base + "\\failover-required")) { currentEjb.setHasession(value); } else if (currentLoc.equals(base + "\\persistence-manager" + "\\properties-file-location")) { currentEjb.addCmpDescriptor(value); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
Method name: void stdCharacters(String) Method name: void iasCharacters(String)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (currentLoc.equals(base + "\\prim-key-class")) {
1
if (currentLoc.equals(base + "\\iiop")) {
2
                currentEjb.setPrimaryKey(value);
2
                currentEjb.setIiop(value);
3
            } else if (currentLoc.equals(base + "\\session-type")) {
3
            } else if (currentLoc.equals(base + "\\failover-required")) {
4
                currentEjb.setBeantype(value);
4
                currentEjb.setHasession(value);
5
            } else if (currentLoc.equals(base + "\\persistence-type
5
            } else if (currentLoc.equals(base + "\\persistence-manager"
6
")) {
6
                                              + "\\properties-file-location")) {
7
                currentEjb.setCmp(value);
7
                currentEjb.addCmpDescriptor(value);
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.8
Clones locationClones are declared in the same class
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    16
    else if (currentLoc.equals(base + "\\prim-key-class"))
    16
    else if (currentLoc.equals(base + "\\prim-key-class"))
    9
    else if (currentLoc.equals(base + "\\failover-required"))
    Differences
    Expression1Expression2Difference
    "\\prim-key-class""\\failover-required"LITERAL_VALUE_MISMATCH
    9
    else if (currentLoc.equals(base + "\\failover-required"))
    17
    currentEjb.setPrimaryKey(value);
    17
    currentEjb.setPrimaryKey(value);
    10
    currentEjb.setHasession(value);
    Differences
    Expression1Expression2Difference
    setPrimaryKeysetHasessionMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression currentEjb.setPrimaryKey(value) is a void method call, and thus it cannot be parameterized
    Expression currentEjb.setHasession(value) is a void method call, and thus it cannot be parameterized
    10
    currentEjb.setHasession(value);
    18
    else if (currentLoc.equals(base + "\\session-type"))
    18
    else if (currentLoc.equals(base + "\\session-type"))
    7
    else if (currentLoc.equals(base + "\\iiop"))
    Differences
    Expression1Expression2Difference
    "\\session-type""\\iiop"LITERAL_VALUE_MISMATCH
    7
    else if (currentLoc.equals(base + "\\iiop"))
    19
    currentEjb.setBeantype(value);
    19
    currentEjb.setBeantype(value);
    8
    currentEjb.setIiop(value);
    Differences
    Expression1Expression2Difference
    setBeantypesetIiopMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression currentEjb.setBeantype(value) is a void method call, and thus it cannot be parameterized
    Expression currentEjb.setIiop(value) is a void method call, and thus it cannot be parameterized
    8
    currentEjb.setIiop(value);
    20
    else if (currentLoc.equals(base + "\\persistence-type"))
    20
    else if (currentLoc.equals(base + "\\persistence-type"))
    11
    else if (currentLoc.equals(base + "\\persistence-manager" + "\\properties-file-location"))
    Differences
    Expression1Expression2Difference
    "\\persistence-type""\\persistence-manager"LITERAL_VALUE_MISMATCH
    base + "\\persistence-type"base + "\\persistence-manager" + "\\properties-file-location"INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression base + "\\persistence-type" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression base + "\\persistence-manager" + "\\properties-file-location" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    else if (currentLoc.equals(base + "\\persistence-manager" + "\\properties-file-location"))
    21
    currentEjb.setCmp(value);
    21
    currentEjb.setCmp(value);
    12
    currentEjb.addCmpDescriptor(value);
    Differences
    Expression1Expression2Difference
    setCmpaddCmpDescriptorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression currentEjb.setCmp(value) is a void method call, and thus it cannot be parameterized
    Expression currentEjb.addCmpDescriptor(value) is a void method call, and thus it cannot be parameterized
    12
    currentEjb.addCmpDescriptor(value);
    Precondition Violations (8)
    Row Violation
    1Expression currentEjb.setPrimaryKey(value) is a void method call, and thus it cannot be parameterized
    2Expression currentEjb.setHasession(value) is a void method call, and thus it cannot be parameterized
    3Expression currentEjb.setBeantype(value) is a void method call, and thus it cannot be parameterized
    4Expression currentEjb.setIiop(value) is a void method call, and thus it cannot be parameterized
    5Expression base + "\\persistence-type" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression base + "\\persistence-manager" + "\\properties-file-location" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression currentEjb.setCmp(value) is a void method call, and thus it cannot be parameterized
    8Expression currentEjb.addCmpDescriptor(value) is a void method call, and thus it cannot be parameterized