if (prefixes.add(localName)) { handler.startPrefixMapping(localName, nodeValue); }
if (!uri.equals(originalURI)) { // record duplicate declaration for a given prefix (#3) addNSDeclaration(prefix, uri); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLLoadImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java
Method name: void traverseElement(Element, AttributesProxy, DefaultHandler, LexicalHandler) Method name: void recordPrefixToURIMapping()
Number of AST nodes: 2 Number of AST nodes: 2
1
if (prefixes.add(localName))
1
if (!uri.equals(originalURI))
2
            {
2
        
3
  
3
{
4
            handler.startPrefixMapping(localName, nodeValue);
4
          
5
    
5
// record duplicate declaration for a given prefix (#3)
6
          addNSDeclaration(prefix, uri);
6
        }
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.1
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)376.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    15
    if (prefixes.add(localName))
    15
    if (prefixes.add(localName))
    14
    if (!uri.equals(originalURI))
    Differences
    Expression1Expression2Difference
    prefixes.add(localName)!uri.equals(originalURI)TYPE_COMPATIBLE_REPLACEMENT
    14
    if (!uri.equals(originalURI))
    16
    handler.startPrefixMapping(localName, nodeValue);
    16
    handler.startPrefixMapping(localName, nodeValue);
    15
    addNSDeclaration(prefix, uri);
    Differences
    Expression1Expression2Difference
    startPrefixMappingaddNSDeclarationMETHOD_INVOCATION_NAME_MISMATCH
    localNameprefixVARIABLE_NAME_MISMATCH
    nodeValueuriVARIABLE_NAME_MISMATCH
    handlerMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression handler.startPrefixMapping(localName,nodeValue) is a void method call, and thus it cannot be parameterized
    Expression addNSDeclaration(prefix,uri) is a void method call, and thus it cannot be parameterized
    Expression handler.startPrefixMapping(localName,nodeValue) is a void method call, and thus it cannot be parameterized
    Expression addNSDeclaration(prefix,uri) is a void method call, and thus it cannot be parameterized
    15
    addNSDeclaration(prefix, uri);
    Precondition Violations (4)
    Row Violation
    1Expression handler.startPrefixMapping(localName,nodeValue) is a void method call, and thus it cannot be parameterized
    2Expression addNSDeclaration(prefix,uri) is a void method call, and thus it cannot be parameterized
    3Expression handler.startPrefixMapping(localName,nodeValue) is a void method call, and thus it cannot be parameterized
    4Expression addNSDeclaration(prefix,uri) is a void method call, and thus it cannot be parameterized