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 (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: 7 Number of AST nodes: 7
1
if (commandList.isEmpty())
1
if (commandList.isEmpty())
2
    {
2
    {
3
      return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");
3
      return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");
4
    }
4
    }
5
    else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL)
5
    else if (resultIndex == LAST_COMMAND_ALL || resultIndex == MERGE_COMMAND_ALL)
6
    {
6
    {
7
      return commandList.get(commandList.size() - 1).getLabel();
7
      return commandList.get(commandList.size() - 1).getDescription();
8
    }
8
    }
9
    else if (resultIndex < commandList.size())
9
    else if (resultIndex < commandList.size())
10
    {
10
    {
11
      return commandList.get(resultIndex).getLabel();
11
      return commandList.get(resultIndex).getDescription();
12
    }
12
    }
13
    else
13
    else
14
    {
14
    {
15
      return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_label");
15
      return CommonPlugin.INSTANCE.getString("_UI_CompoundCommand_description");
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.5
Clones locationClones are declared in the same class
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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