boolean hasCommandOwner = commandOwner != null; if (!hasCommandOwner) { setCommandOwner(DelegatingWrapperItemProvider.this); } itemPropertyDescriptor.setPropertyValue(object, value); if (!hasCommandOwner) { setCommandOwner(null); }
boolean hasCommandOwner = commandOwner != null; if (!hasCommandOwner) { setCommandOwner(DelegatingWrapperItemProvider.this); } itemPropertyDescriptor.resetPropertyValue(object); if (!hasCommandOwner) { setCommandOwner(null); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/DelegatingWrapperItemProvider.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/DelegatingWrapperItemProvider.java
Method name: void setPropertyValue(Object, Object) Method name: void resetPropertyValue(Object)
Number of AST nodes: 6 Number of AST nodes: 6
1
boolean hasCommandOwner = commandOwner != null;
1
boolean hasCommandOwner = commandOwner != null;
2
      if (!hasCommandOwner)
2
      if (!hasCommandOwner)
3
      {
3
      {
4
        setCommandOwner(DelegatingWrapperItemProvider.this);
4
        setCommandOwner(DelegatingWrapperItemProvider.this);
5
      }
5
      }
6
      itemPropertyDescriptor.setPropertyValue(object, value);
6
      itemPropertyDescriptor.resetPropertyValue(object);
7
      if (!hasCommandOwner)
7
      if (!hasCommandOwner)
8
      {
8
      {
9
        setCommandOwner(null);
9
        setCommandOwner(null);
10
      }
10
      }
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.1
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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 2
    Mapped Statements
    ID Statement ID Statement
    1
    boolean hasCommandOwner = commandOwner != null;
    1
    boolean hasCommandOwner = commandOwner != null;
    2
    if (!hasCommandOwner)
    2
    if (!hasCommandOwner)
    3
    setCommandOwner(DelegatingWrapperItemProvider.this);
    3
    setCommandOwner(DelegatingWrapperItemProvider.this);
    4
    itemPropertyDescriptor.setPropertyValue(object, value);
    4
    itemPropertyDescriptor.setPropertyValue(object, value);
    4
    itemPropertyDescriptor.resetPropertyValue(object);
    Differences
    Expression1Expression2Difference
    setPropertyValueresetPropertyValueMETHOD_INVOCATION_NAME_MISMATCH
    itemPropertyDescriptor.setPropertyValue(object,value)itemPropertyDescriptor.resetPropertyValue(object)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression itemPropertyDescriptor.setPropertyValue(object,value) is a void method call, and thus it cannot be parameterized
    Expression itemPropertyDescriptor.resetPropertyValue(object) is a void method call, and thus it cannot be parameterized
    Expression itemPropertyDescriptor.setPropertyValue(object,value) is a void method call, and thus it cannot be parameterized
    Expression itemPropertyDescriptor.resetPropertyValue(object) is a void method call, and thus it cannot be parameterized
    4
    itemPropertyDescriptor.resetPropertyValue(object);
    5
    if (!hasCommandOwner)
    5
    if (!hasCommandOwner)
    6
    setCommandOwner(null);
    6
    setCommandOwner(null);
    Precondition Violations (4)
    Row Violation
    1Expression itemPropertyDescriptor.setPropertyValue(object,value) is a void method call, and thus it cannot be parameterized
    2Expression itemPropertyDescriptor.resetPropertyValue(object) is a void method call, and thus it cannot be parameterized
    3Expression itemPropertyDescriptor.setPropertyValue(object,value) is a void method call, and thus it cannot be parameterized
    4Expression itemPropertyDescriptor.resetPropertyValue(object) is a void method call, and thus it cannot be parameterized