if (resourceAttributes == null) { resourceAttributes = resource.getResourceAttributes(); } result.put(URIConverter.ATTRIBUTE_DIRECTORY, resource instanceof IContainer);
if (resourceAttributes == null) { resourceAttributes = resource.getResourceAttributes(); } result.put(URIConverter.ATTRIBUTE_ARCHIVE, resourceAttributes.isArchive());
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/PlatformResourceURIHandlerImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/PlatformResourceURIHandlerImpl.java
Method name: Map attributes(String, Map) Method name: Map attributes(String, Map)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (resourceAttributes == null)
1
if (resourceAttributes == null)
2
          {
2
          {
3
            resourceAttributes = resource.getResourceAttributes();
3
            resourceAttributes = resource.getResourceAttributes();
4
          }
4
          }
5
          result.put(URIConverter.ATTRIBUTE_DIRECTORY, resource instanceof IContainer);
5
          result.put(URIConverter.ATTRIBUTE_ARCHIVE,  resourceAttributes.isArchive());
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 comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)16.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    24
    if (resourceAttributes == null)
    12
    if (resourceAttributes == null)
    25
    resourceAttributes = resource.getResourceAttributes();
    13
    resourceAttributes = resource.getResourceAttributes();
    26
    result.put(URIConverter.ATTRIBUTE_DIRECTORY, resource instanceof IContainer);
    26
    result.put(URIConverter.ATTRIBUTE_DIRECTORY, resource instanceof IContainer);
    14
    result.put(URIConverter.ATTRIBUTE_ARCHIVE, resourceAttributes.isArchive());
    Differences
    Expression1Expression2Difference
    ATTRIBUTE_DIRECTORYATTRIBUTE_ARCHIVEVARIABLE_NAME_MISMATCH
    14
    result.put(URIConverter.ATTRIBUTE_ARCHIVE, resourceAttributes.isArchive());
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables , while Clone fragment #2 returns variables resourceAttributes