Collection<IAction> actions = new ArrayList<IAction>(); if (descriptors != null) { for (Object descriptor : descriptors) { if (!showGenericsAction.isChecked() && descriptor instanceof CommandParameter) { Object feature = ((CommandParameter)descriptor).getFeature(); if (isGenericFeature(feature)) { continue; } } actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); } } return actions;
Collection<IAction> actions = new ArrayList<IAction>(); if (descriptors != null) { for (Object descriptor : descriptors) { if (!showGenericsAction.isChecked() && descriptor instanceof CommandParameter) { Object feature = ((CommandParameter)descriptor).getFeature(); if (isGenericFeature(feature)) { continue; } } actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); } } return actions;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/presentation/EcoreActionBarContributor.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/presentation/EcoreActionBarContributor.java
Method name: Collection generateCreateChildActions(Collection, ISelection) Method name: Collection generateCreateSiblingActions(Collection, ISelection)
Number of AST nodes: 9 Number of AST nodes: 9
1
Collection<IAction> actions = new ArrayList<IAction>();
1
Collection<IAction> actions = new ArrayList<IAction>();
2
    if (descriptors != null)
2
    if (descriptors != null)
3
    {
3
    {
4
      for (Object descriptor : descriptors)
4
      for (Object descriptor : descriptors)
5
      {
5
      {
6
        if (!showGenericsAction.isChecked() && descriptor instanceof CommandParameter)
6
        if (!showGenericsAction.isChecked() && descriptor instanceof CommandParameter)
7
        {
7
        {
8
          Object feature = ((CommandParameter)descriptor).getFeature();
8
          Object feature = ((CommandParameter)descriptor).getFeature();
9
          if (isGenericFeature(feature))
9
          if (isGenericFeature(feature))
10
          {
10
          {
11
            continue;
11
            continue;
12
          }
12
          }
13
        }
13
        }
14
        actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
14
        actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
15
      }
15
      }
16
    }
16
    }
17
    return actions;
17
    return actions;
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.3
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    4
    if (!showGenericsAction.isChecked() && descriptor instanceof CommandParameter)
    4
    if (!showGenericsAction.isChecked() && descriptor instanceof CommandParameter)
    5
    Object feature = ((CommandParameter)descriptor).getFeature();
    5
    Object feature = ((CommandParameter)descriptor).getFeature();
    6
    if (isGenericFeature(feature))
    6
    if (isGenericFeature(feature))
    7
    continue;
    7
    continue;
    7
    continue;
    Preondition Violations
    Statement continue; without innermost loop
    Statement continue; without innermost loop
    7
    continue;
    Precondition Violations (2)
    Row Violation
    1Statement continue; without innermost loop
    2Statement continue; without innermost loop