if (topLabelCaseAll.length > 0) { String labelCase = topLabelCaseAll[0].getAttribute("value"); if (labelCase.equalsIgnoreCase("upper")) { topLabelCase = LABEL_UPPER; } else if (labelCase.equalsIgnoreCase("lower")) { topLabelCase = LABEL_LOWER; } else if (labelCase.equalsIgnoreCase("mixed")) { topLabelCase = LABEL_MIXED; } }
if (bottomLabelCaseAll.length > 0) { String labelCase = bottomLabelCaseAll[0].getAttribute("value"); if (labelCase.equalsIgnoreCase("upper")) { bottomLabelCase = LABEL_UPPER; } else if (labelCase.equalsIgnoreCase("lower")) { bottomLabelCase = LABEL_LOWER; } else if (labelCase.equalsIgnoreCase("mixed")) { bottomLabelCase = LABEL_MIXED; } }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/domain/PluginAdapterFactoryMappingDomain.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/domain/PluginAdapterFactoryMappingDomain.java
Method name: void initializeFromPlugin(String) Method name: void initializeFromPlugin(String)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (topLabelCaseAll.length > 0) 
1
if (bottomLabelCaseAll.length > 0) 
2
          {
2
          {
3
            String labelCase =  topLabelCaseAll[0].getAttribute("value");
3
            String labelCase =  bottomLabelCaseAll[0].getAttribute("value");
4
            if (labelCase.equalsIgnoreCase("upper")) 
4
            if (labelCase.equalsIgnoreCase("upper")) 
5
            {
5
            {
6
              topLabelCase = LABEL_UPPER;
6
              bottomLabelCase = LABEL_UPPER;
7
            }
7
            }
8
            else if (labelCase.equalsIgnoreCase("lower")) 
8
            else if (labelCase.equalsIgnoreCase("lower")) 
9
            {
9
            {
10
              topLabelCase = LABEL_LOWER;
10
              bottomLabelCase = LABEL_LOWER;
11
            }
11
            }
12
            else if (labelCase.equalsIgnoreCase("mixed")) 
12
            else if (labelCase.equalsIgnoreCase("mixed")) 
13
            {
13
            {
14
              topLabelCase = LABEL_MIXED;
14
              bottomLabelCase = LABEL_MIXED;
15
            }
15
            }
16
          }
16
          }
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 in the same method
Number of node comparisons33
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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
    28
    if (topLabelCaseAll.length > 0)
    28
    if (topLabelCaseAll.length > 0)
    37
    if (bottomLabelCaseAll.length > 0)
    Differences
    Expression1Expression2Difference
    topLabelCaseAllbottomLabelCaseAllVARIABLE_NAME_MISMATCH
    37
    if (bottomLabelCaseAll.length > 0)
    29
    String labelCase = topLabelCaseAll[0].getAttribute("value");
    29
    String labelCase = topLabelCaseAll[0].getAttribute("value");
    38
    String labelCase = bottomLabelCaseAll[0].getAttribute("value");
    Differences
    Expression1Expression2Difference
    topLabelCaseAllbottomLabelCaseAllVARIABLE_NAME_MISMATCH
    38
    String labelCase = bottomLabelCaseAll[0].getAttribute("value");
    30
    if (labelCase.equalsIgnoreCase("upper"))
    39
    if (labelCase.equalsIgnoreCase("upper"))
    31
    topLabelCase = LABEL_UPPER;
    31
    topLabelCase = LABEL_UPPER;
    40
    bottomLabelCase = LABEL_UPPER;
    Differences
    Expression1Expression2Difference
    topLabelCasebottomLabelCaseVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression topLabelCase is a field being modified, and thus it cannot be parameterized
    Expression bottomLabelCase is a field being modified, and thus it cannot be parameterized
    40
    bottomLabelCase = LABEL_UPPER;
    32
    else if (labelCase.equalsIgnoreCase("lower"))
    41
    else if (labelCase.equalsIgnoreCase("lower"))
    33
    topLabelCase = LABEL_LOWER;
    33
    topLabelCase = LABEL_LOWER;
    42
    bottomLabelCase = LABEL_LOWER;
    Differences
    Expression1Expression2Difference
    topLabelCasebottomLabelCaseVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression topLabelCase is a field being modified, and thus it cannot be parameterized
    Expression bottomLabelCase is a field being modified, and thus it cannot be parameterized
    42
    bottomLabelCase = LABEL_LOWER;
    34
    else if (labelCase.equalsIgnoreCase("mixed"))
    43
    else if (labelCase.equalsIgnoreCase("mixed"))
    35
    topLabelCase = LABEL_MIXED;
    35
    topLabelCase = LABEL_MIXED;
    44
    bottomLabelCase = LABEL_MIXED;
    Differences
    Expression1Expression2Difference
    topLabelCasebottomLabelCaseVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression topLabelCase is a field being modified, and thus it cannot be parameterized
    Expression bottomLabelCase is a field being modified, and thus it cannot be parameterized
    44
    bottomLabelCase = LABEL_MIXED;
    Precondition Violations (6)
    Row Violation
    1Expression topLabelCase is a field being modified, and thus it cannot be parameterized
    2Expression bottomLabelCase is a field being modified, and thus it cannot be parameterized
    3Expression topLabelCase is a field being modified, and thus it cannot be parameterized
    4Expression bottomLabelCase is a field being modified, and thus it cannot be parameterized
    5Expression topLabelCase is a field being modified, and thus it cannot be parameterized
    6Expression bottomLabelCase is a field being modified, and thus it cannot be parameterized