basicSetTarget(target); List<EObject> contents = target.getContents(); for (int i = 0, size = contents.size(); i < size; ++i) { Notifier notifier = contents.get(i); addAdapter(notifier); }
basicUnsetTarget(target); List<EObject> contents = target.getContents(); for (int i = 0, size = contents.size(); i < size; ++i) { Notifier notifier = contents.get(i); removeAdapter(notifier); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentAdapter.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentAdapter.java
Method name: void setTarget(Resource) Method name: void unsetTarget(Resource)
Number of AST nodes: 5 Number of AST nodes: 5
1
basicSetTarget(target);
1
basicUnsetTarget(target);
2
    List<EObject> contents = target.getContents();
2
    List<EObject> contents = target.getContents();
3
    for (int i = 0, size = contents.size(); i < size; ++i)
3
    for (int i = 0, size = contents.size(); i < size; ++i)
4
    {
4
    {
5
      Notifier notifier = contents.get(i);
5
      Notifier notifier = contents.get(i);
6
      addAdapter(notifier);
6
      removeAdapter(notifier);
7
    }
7
    }
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.2
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    basicSetTarget(target);
    1
    basicSetTarget(target);
    1
    basicUnsetTarget(target);
    Differences
    Expression1Expression2Difference
    basicSetTargetbasicUnsetTargetMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression basicSetTarget(target) is a void method call, and thus it cannot be parameterized
    Expression basicUnsetTarget(target) is a void method call, and thus it cannot be parameterized
    1
    basicUnsetTarget(target);
    2
    List<EObject> contents = target.getContents();
    2
    List<EObject> contents = target.getContents();
    3
    for (int i = 0, size = contents.size(); i < size; ++i)
    3
    for (int i = 0, size = contents.size(); i < size; ++i)
    4
    Notifier notifier = contents.get(i);
    4
    Notifier notifier = contents.get(i);
    5
    addAdapter(notifier);
    5
    addAdapter(notifier);
    5
    removeAdapter(notifier);
    Differences
    Expression1Expression2Difference
    addAdapterremoveAdapterMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression addAdapter(notifier) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression removeAdapter(notifier) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addAdapter(notifier) is a void method call, and thus it cannot be parameterized
    Expression removeAdapter(notifier) is a void method call, and thus it cannot be parameterized
    5
    removeAdapter(notifier);
    Precondition Violations (6)
    Row Violation
    1Expression basicSetTarget(target) is a void method call, and thus it cannot be parameterized
    2Expression basicUnsetTarget(target) is a void method call, and thus it cannot be parameterized
    3Expression addAdapter(notifier) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression removeAdapter(notifier) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression addAdapter(notifier) is a void method call, and thus it cannot be parameterized
    6Expression removeAdapter(notifier) is a void method call, and thus it cannot be parameterized