if (testChar == '%') { if (index+2 >= end || !isHex(p_uriSpec.charAt(index+1)) || !isHex(p_uriSpec.charAt(index+2))) { throw new MalformedURIException( "Opaque part contains invalid escape sequence!"); } index += 2; } // If the scheme specific part is opaque, it can contain '[' // and ']'. uric_no_slash wasn't modified by RFC 2732, which // I've interpreted as an error in the spec, since the // production should be equivalent to (uric - '/'), and uric // contains '[' and ']'. - mrglavas else if (!isURICharacter(testChar)) { throw new MalformedURIException( "Opaque part 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( "Query string contains invalid escape sequence!"); } index += 2; } else if (!isURICharacter(testChar)) { throw new MalformedURIException( "Query string 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
                            "Opaque part contains invalid escape sequence!");
6
                    "Query string contains invalid escape sequence!");
7
                    }
7
           
8
         
8
}
9
           index += 2;
9
           index += 2;
10
                }
10
        }
11
                // If the scheme specific part is opaque, it can contain '['
12
                // and ']'. uric_no_slash wasn't modified by RFC 2732, which
13
                // I've interpreted as an error in the spec, since the 
14
                // production should be equivalent to (uric - '/'), and uric
15
                // contains '[' and ']'. - mrglavas
16
                else if (!isURICharacter(testChar)) {
11
        else if (!isURICharacter(testChar)) {
17
                    throw new MalformedURIException(
12
          throw new MalformedURIException(
18
                        "Opaque part contains invalid character: " + testChar);
13
                "Query string contains invalid character: " + testChar);
19
                }
14
        }
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
    24
    if (testChar == '%')
    39
    if (testChar == '%')
    25
    if (index + 2 >= end || !isHex(p_uriSpec.charAt(index + 1)) || !isHex(p_uriSpec.charAt(index + 2)))
    40
    if (index + 2 >= end || !isHex(p_uriSpec.charAt(index + 1)) || !isHex(p_uriSpec.charAt(index + 2)))
    26
    throw new MalformedURIException("Opaque part contains invalid escape sequence!");
    26
    throw new MalformedURIException("Opaque part contains invalid escape sequence!");
    41
    throw new MalformedURIException("Query string contains invalid escape sequence!");
    Differences
    Expression1Expression2Difference
    "Opaque part contains invalid escape sequence!""Query string contains invalid escape sequence!"LITERAL_VALUE_MISMATCH
    41
    throw new MalformedURIException("Query string contains invalid escape sequence!");
    27
    index += 2;
    42
    index += 2;
    28
    else if (!isURICharacter(testChar))
    43
    else if (!isURICharacter(testChar))
    29
    throw new MalformedURIException("Opaque part contains invalid character: " + testChar);
    29
    throw new MalformedURIException("Opaque part contains invalid character: " + testChar);
    44
    throw new MalformedURIException("Query string contains invalid character: " + testChar);
    Differences
    Expression1Expression2Difference
    "Opaque part contains invalid character: ""Query string contains invalid character: "LITERAL_VALUE_MISMATCH
    44
    throw new MalformedURIException("Query string contains invalid character: " + testChar);
    Precondition Violations (0)
    Row Violation