int responseCode = httpURLConnection.getResponseCode(); switch (responseCode) { case HttpURLConnection.HTTP_OK: case HttpURLConnection.HTTP_CREATED: case HttpURLConnection.HTTP_NO_CONTENT: { break; } default: { throw new IOException("PUT failed with HTTP response code " + responseCode); } }
int responseCode = httpURLConnection.getResponseCode(); switch (responseCode) { case HttpURLConnection.HTTP_OK: case HttpURLConnection.HTTP_ACCEPTED: case HttpURLConnection.HTTP_NO_CONTENT: { break; } default: { throw new IOException("DELETE failed with HTTP response code " + responseCode); } }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/URIHandlerImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/URIHandlerImpl.java
Method name: void close() Method name: void delete(URI, Map)
Number of AST nodes: 8 Number of AST nodes: 8
1
int responseCode = httpURLConnection.getResponseCode();
1
int responseCode = httpURLConnection.getResponseCode();
2
              switch (responseCode)
2
        switch (responseCode)
3
              {
3
        {
4
                case HttpURLConnection.HTTP_OK:
4
          case HttpURLConnection.HTTP_OK:
5
                case HttpURLConnection.HTTP_CREATED:
5
          case HttpURLConnection.HTTP_
6
      
6
ACCEPTED:
7
          case HttpURLConnection.HTTP_NO_CONTENT:
7
          case HttpURLConnection.HTTP_NO_CONTENT:
8
                {
8
          
9
    
9
{
10
              break;
10
            break;
11
                }
11
          
12
    
12
}
13
            default:
13
          default:
14
                {
14
          
15
   
15
{
16
               throw new IOException("PUT failed with HTTP response code " + responseCode);
16
            throw new IOException("DELETE failed with HTTP response code " + responseCode);
17
                }
17
          
18
      
18
}
19
        }
19
        }
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.1
Clones locationClones are in the same java file
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    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
    2
    int responseCode = httpURLConnection.getResponseCode();
    8
    int responseCode = httpURLConnection.getResponseCode();
    3
    switch (responseCode)
    9
    switch (responseCode)
    4
    case HttpURLConnection.HTTP_OK:
    10
    case HttpURLConnection.HTTP_OK:
    5
    case HttpURLConnection.HTTP_CREATED:
    5
    case HttpURLConnection.HTTP_CREATED:
    11
    case HttpURLConnection.HTTP_ACCEPTED:
    Differences
    Expression1Expression2Difference
    HTTP_CREATEDHTTP_ACCEPTEDVARIABLE_NAME_MISMATCH
    11
    case HttpURLConnection.HTTP_ACCEPTED:
    6
    case HttpURLConnection.HTTP_NO_CONTENT:
    12
    case HttpURLConnection.HTTP_NO_CONTENT:
    7
    break;
    13
    break;
    8
    default:
    14
    default:
    9
    throw new IOException("PUT failed with HTTP response code " + responseCode);
    9
    throw new IOException("PUT failed with HTTP response code " + responseCode);
    15
    throw new IOException("DELETE failed with HTTP response code " + responseCode);
    Differences
    Expression1Expression2Difference
    "PUT failed with HTTP response code ""DELETE failed with HTTP response code "LITERAL_VALUE_MISMATCH
    15
    throw new IOException("DELETE failed with HTTP response code " + responseCode);
    Precondition Violations (0)
    Row Violation