if (testChar == '%') { if (index+2 >= end || !isHex(p_uriSpec.charAt(index+1)) || !isHex(p_uriSpec.charAt(index+2))) { throw new MalformedURIException( "Query string contains invalid escape sequence!"); } index += 2; } else if (!isURICharacter(testChar)) { throw new MalformedURIException( "Query string contains invalid character: " + testChar); }
if (testChar == '%') { if (index+2 >= end || !isHex(p_uriSpec.charAt(index+1)) || !isHex(p_uriSpec.charAt(index+2))) { throw new MalformedURIException( "Fragment contains invalid escape sequence!"); } index += 2; } else if (!isURICharacter(testChar)) { throw new MalformedURIException( "Fragment contains invalid character: "+testChar); }
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 initializePath(String, int) Method name: void initializePath(String, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (testChar == '%') {
1
if (testChar == '%') {
2
           if (index+2 >= end ||
2
           if (index+2 >= end ||
3
              !isHex(p_uriSpec.charAt(index+1)) ||
3
              !isHex(p_uriSpec.charAt(index+1)) ||
4
              !isHex(p_uriSpec.charAt(index+2))) {
4
              !isHex(p_uriSpec.charAt(index+2))) {
5
            throw new MalformedURIException(
5
            throw new MalformedURIException(
6
                    "Query string contains invalid escape sequence!");
6
                    "Fragment contains invalid escape sequence!");
7
           }
7
           }
8
           index += 2;
8
           index += 2;
9
        }
9
        }
10
        else if (!isURICharacter(testChar)) {
10
        else if (!isURICharacter(testChar)) {
11
          throw new MalformedURIException(
11
          throw new MalformedURIException(
12
                "Query string contains invalid character: " + testChar);
12
                "Fragment contains invalid character: "+testChar);
13
        }
13
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.7
Clones locationClones are in the same method
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    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
    39
    if (testChar == '%')
    52
    if (testChar == '%')
    40
    if (index + 2 >= end || !isHex(p_uriSpec.charAt(index + 1)) || !isHex(p_uriSpec.charAt(index + 2)))
    53
    if (index + 2 >= end || !isHex(p_uriSpec.charAt(index + 1)) || !isHex(p_uriSpec.charAt(index + 2)))
    41
    throw new MalformedURIException("Query string contains invalid escape sequence!");
    41
    throw new MalformedURIException("Query string contains invalid escape sequence!");
    54
    throw new MalformedURIException("Fragment contains invalid escape sequence!");
    Differences
    Expression1Expression2Difference
    "Query string contains invalid escape sequence!""Fragment contains invalid escape sequence!"LITERAL_VALUE_MISMATCH
    54
    throw new MalformedURIException("Fragment contains invalid escape sequence!");
    42
    index += 2;
    55
    index += 2;
    43
    else if (!isURICharacter(testChar))
    56
    else if (!isURICharacter(testChar))
    44
    throw new MalformedURIException("Query string contains invalid character: " + testChar);
    44
    throw new MalformedURIException("Query string contains invalid character: " + testChar);
    57
    throw new MalformedURIException("Fragment contains invalid character: " + testChar);
    Differences
    Expression1Expression2Difference
    "Query string contains invalid character: ""Fragment contains invalid character: "LITERAL_VALUE_MISMATCH
    57
    throw new MalformedURIException("Fragment contains invalid character: " + testChar);
    Precondition Violations (0)
    Row Violation