Node node = attributes.item(index); if (node != null) { String namespaceURI = node.getNamespaceURI(); if (ExtendedMetaData.XMLNS_URI.equals(namespaceURI)) { return ""; } return namespaceURI; } return null;
Node node = attributes.item(index); if (node != null) { String prefix = node.getPrefix(); if (ExtendedMetaData.XMLNS_PREFIX.equals(prefix)) { return ""; } return node.getLocalName(); } return null;
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/XMLLoadImpl.java
Method name: String getURI(int) Method name: String getLocalName(int)
Number of AST nodes: 7 Number of AST nodes: 7
1
Node node = attributes.item(index);
1
Node node = attributes.item(index);
2
      if (node != null)
2
      if (node != null)
3
      {
3
      {
4
        String namespaceURI = node.getNamespaceURI();
4
        String prefix = node.getPrefix();
5
        if (ExtendedMetaData.XMLNS_URI.equals(namespaceURI))
5
        if (ExtendedMetaData.XMLNS_PREFIX.equals(prefix))
6
        {
6
        {
7
          return "";
7
          return "";
8
        }
8
        }
9
        return namespaceURI;
9
        return node.getLocalName();
10
      }
10
      }
11
      return null;
11
      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.2
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Node node = attributes.item(index);
    1
    Node node = attributes.item(index);
    2
    if (node != null)
    2
    if (node != null)
    3
    String namespaceURI = node.getNamespaceURI();
    3
    String namespaceURI = node.getNamespaceURI();
    3
    String prefix = node.getPrefix();
    Differences
    Expression1Expression2Difference
    namespaceURIprefixVARIABLE_NAME_MISMATCH
    getNamespaceURIgetPrefixMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression node.getNamespaceURI() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression node.getPrefix() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    String prefix = node.getPrefix();
    4
    if (ExtendedMetaData.XMLNS_URI.equals(namespaceURI))
    4
    if (ExtendedMetaData.XMLNS_URI.equals(namespaceURI))
    4
    if (ExtendedMetaData.XMLNS_PREFIX.equals(prefix))
    Differences
    Expression1Expression2Difference
    namespaceURIprefixVARIABLE_NAME_MISMATCH
    XMLNS_URIXMLNS_PREFIXVARIABLE_NAME_MISMATCH
    4
    if (ExtendedMetaData.XMLNS_PREFIX.equals(prefix))
    5
    return "";
    5
    return "";
    6
    return namespaceURI;
    6
    return namespaceURI;
    6
    return node.getLocalName();
    Differences
    Expression1Expression2Difference
    namespaceURInode.getLocalName()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression namespaceURI cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression node.getLocalName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    return node.getLocalName();
    7
    return null;
    7
    return null;
    Precondition Violations (4)
    Row Violation
    1Expression node.getNamespaceURI() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression node.getPrefix() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression namespaceURI cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression node.getLocalName() cannot be parameterized, because it has dependencies to/from statements that will be extracted