if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_LENGTH)) { if (inputStream == null) { inputStream = getInputStream(); inputStream.close(); } result.put(URIConverter.ATTRIBUTE_LENGTH, zipEntry.getSize()); }
if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_TIME_STAMP)) { if (inputStream == null) { inputStream = getInputStream(); inputStream.close(); } result.put(URIConverter.ATTRIBUTE_TIME_STAMP, zipEntry.getTime()); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ArchiveURIHandlerImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ArchiveURIHandlerImpl.java
Method name: Map getAttributes() Method name: Map getAttributes()
Number of AST nodes: 5 Number of AST nodes: 5
1
if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_LENGTH))
1
if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_TIME_STAMP))
2
        {
2
        {
3
          if (inputStream == null)
3
          if (inputStream == null)
4
          {
4
          {
5
            inputStream = getInputStream();
5
            inputStream = getInputStream();
6
            inputStream.close();
6
            inputStream.close();
7
          }
7
          }
8
          result.put(URIConverter.ATTRIBUTE_LENGTH, zipEntry.getSize());
8
          result.put(URIConverter.ATTRIBUTE_TIME_STAMP, zipEntry.getTime());
9
        }
9
        }
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.3
Clones locationClones are in the same method
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_LENGTH))
    14
    if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_LENGTH))
    19
    if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_TIME_STAMP))
    Differences
    Expression1Expression2Difference
    ATTRIBUTE_LENGTHATTRIBUTE_TIME_STAMPVARIABLE_NAME_MISMATCH
    19
    if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_TIME_STAMP))
    15
    if (inputStream == null)
    20
    if (inputStream == null)
    16
    inputStream = getInputStream();
    21
    inputStream = getInputStream();
    17
    inputStream.close();
    22
    inputStream.close();
    18
    result.put(URIConverter.ATTRIBUTE_LENGTH, zipEntry.getSize());
    18
    result.put(URIConverter.ATTRIBUTE_LENGTH, zipEntry.getSize());
    23
    result.put(URIConverter.ATTRIBUTE_TIME_STAMP, zipEntry.getTime());
    Differences
    Expression1Expression2Difference
    ATTRIBUTE_LENGTHATTRIBUTE_TIME_STAMPVARIABLE_NAME_MISMATCH
    getSizegetTimeMETHOD_INVOCATION_NAME_MISMATCH
    23
    result.put(URIConverter.ATTRIBUTE_TIME_STAMP, zipEntry.getTime());
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables inputStream , while Clone fragment #2 returns variables