if (label != null) { return label; } else if (commandList.isEmpty()) { return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label"); } else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL) { return commandList.get(commandList.size() - 1).getLabel(); } else if (resultIndex < commandList.size()) { return commandList.get(resultIndex).getLabel(); } else { return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label"); }
if (description != null) { return description; } else if (commandList.isEmpty()) { return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description"); } else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL) { return commandList.get(commandList.size() - 1).getDescription(); } else if (resultIndex < commandList.size()) { return commandList.get(resultIndex).getDescription(); } else { return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description"); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/command/CompoundCommand.java File path: /emf-2.4.1/src/org/eclipse/emf/common/command/CompoundCommand.java
Method name: String getLabel() Method name: String getDescription()
Number of AST nodes: 9 Number of AST nodes: 9
1
if (label != null)
1
if (description != null)
2
    {
2
    {
3
      return label;
3
      return description;
4
    } 
4
    } 
5
    else if (commandList.isEmpty())
5
    else if (commandList.isEmpty())
6
    {
6
    {
7
      return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");
7
      return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");
8
    }
8
    }
9
    else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL)
9
    else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL)
10
    {
10
    {
11
      return commandList.get(commandList.size() - 1).getLabel();
11
      return commandList.get(commandList.size() - 1).getDescription();
12
    }
12
    }
13
    else if (resultIndex < commandList.size())
13
    else if (resultIndex < commandList.size())
14
    {
14
    {
15
      return commandList.get(resultIndex).getLabel();
15
      return commandList.get(resultIndex).getDescription();
16
    }
16
    }
17
    else
17
    else
18
    {
18
    {
19
      return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");
19
      return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");
20
    }
20
    }
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 comparisons57
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)15.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (label != null)
    1
    if (label != null)
    1
    if (description != null)
    Differences
    Expression1Expression2Difference
    labeldescriptionVARIABLE_NAME_MISMATCH
    1
    if (description != null)
    2
    return label;
    2
    return label;
    2
    return description;
    Differences
    Expression1Expression2Difference
    labeldescriptionVARIABLE_NAME_MISMATCH
    2
    return description;
    3
    else if (commandList.isEmpty())
    3
    else if (commandList.isEmpty())
    4
    return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");
    4
    return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");
    4
    return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");
    Differences
    Expression1Expression2Difference
    "_UI_CompoundCommand_label""_UI_CompoundCommand_description"LITERAL_VALUE_MISMATCH
    4
    return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");
    5
    else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL)
    5
    else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL)
    6
    return commandList.get(commandList.size() - 1).getLabel();
    6
    return commandList.get(commandList.size() - 1).getLabel();
    6
    return commandList.get(commandList.size() - 1).getDescription();
    Differences
    Expression1Expression2Difference
    getLabelgetDescriptionMETHOD_INVOCATION_NAME_MISMATCH
    6
    return commandList.get(commandList.size() - 1).getDescription();
    7
    else if (resultIndex < commandList.size())
    7
    else if (resultIndex < commandList.size())
    8
    return commandList.get(resultIndex).getLabel();
    8
    return commandList.get(resultIndex).getLabel();
    8
    return commandList.get(resultIndex).getDescription();
    Differences
    Expression1Expression2Difference
    getLabelgetDescriptionMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression commandList.get(resultIndex).getLabel() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression commandList.get(resultIndex).getDescription() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    return commandList.get(resultIndex).getDescription();
    else
    else
    9
    return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");
    9
    return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");
    9
    return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");
    Differences
    Expression1Expression2Difference
    "_UI_CompoundCommand_label""_UI_CompoundCommand_description"LITERAL_VALUE_MISMATCH
    9
    return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");
    Precondition Violations (2)
    Row Violation
    1Expression commandList.get(resultIndex).getLabel() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression commandList.get(resultIndex).getDescription() cannot be parameterized, because it has dependencies to/from statements that will be extracted