if (p_queryString == null) { m_queryString = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Query string can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Query string cannot be set when path is null!"); } else if (!isURIString(p_queryString)) { throw new MalformedURIException( "Query string contains invalid character!"); } else { m_queryString = p_queryString; }
if (p_fragment == null) { m_fragment = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Fragment can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Fragment cannot be set when path is null!"); } else if (!isURIString(p_fragment)) { throw new MalformedURIException( "Fragment contains invalid character!"); } else { m_fragment = p_fragment; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/DataValue.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/DataValue.java
Method name: void setQueryString(String) Method name: void setFragment(String)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (p_queryString == null) {
1
if (p_fragment == null) {
2
      m_queryString = null;
2
      m_fragment = null;
3
    }
3
    }
4
    else if (!isGenericURI()) {
4
    else if (!isGenericURI()) {
5
      throw new MalformedURIException(
5
      throw new MalformedURIException(
6
              "Query string can only be set for a generic URI!");
6
         "Fragment can only be set for a generic URI!");
7
    }
7
    }
8
    else if (getPath() == null) {
8
    else if (getPath() == null) {
9
      throw new MalformedURIException(
9
      throw new MalformedURIException(
10
              "Query string cannot be set when path is null!");
10
              "Fragment cannot be set when path is null!");
11
    }
11
    }
12
    else if (!isURIString(p_queryString)) {
12
    else if (!isURIString(p_fragment)) {
13
      throw new MalformedURIException(
13
      throw new MalformedURIException(
14
              "Query string contains invalid character!");
14
              "Fragment contains invalid character!");
15
    }
15
    }
16
    else {
16
    else {
17
      m_queryString = p_queryString;
17
      m_fragment = p_fragment;
18
    }
18
    }
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.6
Clones locationClones are declared in the same class
Number of node comparisons57
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (p_queryString == null)
    1
    if (p_queryString == null)
    1
    if (p_fragment == null)
    Differences
    Expression1Expression2Difference
    p_queryStringp_fragmentVARIABLE_NAME_MISMATCH
    1
    if (p_fragment == null)
    2
    m_queryString = null;
    2
    m_queryString = null;
    2
    m_fragment = null;
    Differences
    Expression1Expression2Difference
    m_queryStringm_fragmentVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression m_queryString is a field being modified, and thus it cannot be parameterized
    Expression m_fragment is a field being modified, and thus it cannot be parameterized
    2
    m_fragment = null;
    3
    else if (!isGenericURI())
    3
    else if (!isGenericURI())
    4
    throw new MalformedURIException("Query string can only be set for a generic URI!");
    4
    throw new MalformedURIException("Query string can only be set for a generic URI!");
    4
    throw new MalformedURIException("Fragment can only be set for a generic URI!");
    Differences
    Expression1Expression2Difference
    "Query string can only be set for a generic URI!""Fragment can only be set for a generic URI!"LITERAL_VALUE_MISMATCH
    4
    throw new MalformedURIException("Fragment can only be set for a generic URI!");
    5
    else if (getPath() == null)
    5
    else if (getPath() == null)
    6
    throw new MalformedURIException("Query string cannot be set when path is null!");
    6
    throw new MalformedURIException("Query string cannot be set when path is null!");
    6
    throw new MalformedURIException("Fragment cannot be set when path is null!");
    Differences
    Expression1Expression2Difference
    "Query string cannot be set when path is null!""Fragment cannot be set when path is null!"LITERAL_VALUE_MISMATCH
    6
    throw new MalformedURIException("Fragment cannot be set when path is null!");
    7
    else if (!isURIString(p_queryString))
    7
    else if (!isURIString(p_queryString))
    7
    else if (!isURIString(p_fragment))
    Differences
    Expression1Expression2Difference
    p_queryStringp_fragmentVARIABLE_NAME_MISMATCH
    7
    else if (!isURIString(p_fragment))
    8
    throw new MalformedURIException("Query string contains invalid character!");
    8
    throw new MalformedURIException("Query string contains invalid character!");
    8
    throw new MalformedURIException("Fragment contains invalid character!");
    Differences
    Expression1Expression2Difference
    "Query string contains invalid character!""Fragment contains invalid character!"LITERAL_VALUE_MISMATCH
    8
    throw new MalformedURIException("Fragment contains invalid character!");
    else
    else
    9
    m_queryString = p_queryString;
    9
    m_queryString = p_queryString;
    9
    m_fragment = p_fragment;
    Differences
    Expression1Expression2Difference
    m_queryStringm_fragmentVARIABLE_NAME_MISMATCH
    p_queryStringp_fragmentVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression m_queryString is a field being modified, and thus it cannot be parameterized
    Expression m_fragment is a field being modified, and thus it cannot be parameterized
    9
    m_fragment = p_fragment;
    Precondition Violations (4)
    Row Violation
    1Expression m_queryString is a field being modified, and thus it cannot be parameterized
    2Expression m_fragment is a field being modified, and thus it cannot be parameterized
    3Expression m_queryString is a field being modified, and thus it cannot be parameterized
    4Expression m_fragment is a field being modified, and thus it cannot be parameterized