String namespaceURI = namespaceSupport.getURI(prefix); if (namespaceURI == null) { namespaceURI = prefixesToURIs.get(prefix); } return namespaceURI;
EStructuralFeature feature = nodeToFeature.get(node); if (feature == null) { feature = nodeToFeature.get(node.getParentNode()); } return feature;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/DefaultDOMHandlerImpl.java
Method name: String getNamespaceURI(String) Method name: EStructuralFeature getEStructuralFeature(Node)
Number of AST nodes: 4 Number of AST nodes: 4
1
String namespaceURI = namespaceSupport.getURI(prefix);
1
EStructuralFeature feature = nodeToFeature.get(node);
2
    if (namespaceURI == null)
2
        if (feature == null)
3
    {
3
        {
4
      namespaceURI = prefixesToURIs.get(prefix);
4
          feature = nodeToFeature.get(node.getParentNode());
5
    }
5
     
6
   }
6
    return namespaceURI;
7
        return feature;
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 in different classes
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String namespaceURI = namespaceSupport.getURI(prefix);
                                                                                                                  
                                                                                                                  
    13
    EStructuralFeature feature = nodeToFeature.get(node);
    2
    if (namespaceURI == null)
    2
    if (namespaceURI == null)
    14
    if (feature == null)
    Differences
    Expression1Expression2Difference
    namespaceURIfeatureVARIABLE_NAME_MISMATCH
    java.lang.Stringorg.eclipse.emf.ecore.EStructuralFeatureVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable namespaceURI does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature
    • Make classes java.lang.String and org.eclipse.emf.ecore.EStructuralFeature extend a common superclass
    14
    if (feature == null)
    3
    namespaceURI = prefixesToURIs.get(prefix);
    3
    namespaceURI = prefixesToURIs.get(prefix);
    Preondition Violations
    Unmatched statement namespaceURI=prefixesToURIs.get(prefix); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                          
                                                                                                            
    15
    feature = nodeToFeature.get(node.getParentNode());
    Preondition Violations
    Unmatched statement feature=nodeToFeature.get(node.getParentNode()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15
    feature = nodeToFeature.get(node.getParentNode());
    4
    return namespaceURI;
    4
    return namespaceURI;
    Preondition Violations
    Unmatched return namespaceURI;
                                                  
                                          
    16
    return feature;
    Preondition Violations
    Unmatched return feature;
    16
    return feature;
    Precondition Violations (5)
    Row Violation
    1Type java.lang.String of variable namespaceURI does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature
    2Unmatched statement namespaceURI=prefixesToURIs.get(prefix); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement feature=nodeToFeature.get(node.getParentNode()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return namespaceURI;
    5Unmatched return feature;