Object feature = getFeature(); if (feature instanceof EStructuralFeature) { return ((EStructuralFeature)feature).isUnsettable(); } return false;
Object feature = getFeature(); if (feature instanceof EStructuralFeature) { return ((EStructuralFeature)feature).getDefaultValue(); } return null;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/ENotificationImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/ENotificationImpl.java
Method name: boolean isFeatureUnsettable() Method name: Object getFeatureDefaultValue()
Number of AST nodes: 4 Number of AST nodes: 4
1
Object feature = getFeature();
1
Object feature = getFeature();
2
    if (feature instanceof EStructuralFeature)
2
    if (feature instanceof EStructuralFeature)
3
    {
3
    {
4
      return ((EStructuralFeature)feature).isUnsettable();
4
      return ((EStructuralFeature)feature).getDefaultValue();
5
    }
5
    }
6
    return false;
6
    return null;
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 comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Object feature = getFeature();
    1
    Object feature = getFeature();
    2
    if (feature instanceof EStructuralFeature)
    2
    if (feature instanceof EStructuralFeature)
                                                                                                                        
    3
    return ((EStructuralFeature)feature).getDefaultValue();
    Preondition Violations
    Unmatched statement return ((EStructuralFeature)feature).getDefaultValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return ((EStructuralFeature)feature).getDefaultValue();
    3
    return ((EStructuralFeature)feature).getDefaultValue();
    3
    return ((EStructuralFeature)feature).isUnsettable();
    3
    return ((EStructuralFeature)feature).isUnsettable();
    Preondition Violations
    Unmatched statement return ((EStructuralFeature)feature).isUnsettable(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return ((EStructuralFeature)feature).isUnsettable();
                                                                                                                  
                                  
    4
    return null;
    Preondition Violations
    Unmatched return null;
    4
    return null;
    4
    return false;
    4
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    Precondition Violations (6)
    Row Violation
    1Unmatched statement return ((EStructuralFeature)feature).getDefaultValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return ((EStructuralFeature)feature).getDefaultValue();
    3Unmatched statement return ((EStructuralFeature)feature).isUnsettable(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return ((EStructuralFeature)feature).isUnsettable();
    5Unmatched return null;
    6Unmatched return false;