String platformResourcePath = uri.toPlatformString(true); if (workspaceRoot != null) { return WorkbenchHelper.exists(platformResourcePath, options); } else { URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath); return resolvedLocation != null && getURIConverter(options).exists(resolvedLocation, options); }
String platformResourcePath = uri.toPlatformString(true); if (workspaceRoot != null) { return WorkbenchHelper.attributes(platformResourcePath, options); } else { URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath); return resolvedLocation == null ? Collections.<String, Object>emptyMap() : getURIConverter(options).getAttributes(resolvedLocation, options); }
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: boolean exists(URI, Map) Method name: Map getAttributes(URI, Map)
Number of AST nodes: 5 Number of AST nodes: 5
1
String platformResourcePath = uri.toPlatformString(true);
1
String platformResourcePath = uri.toPlatformString(true);
2
    if (workspaceRoot != null)
2
    if (workspaceRoot != null)
3
    {
3
    {
4
      return WorkbenchHelper.exists(platformResourcePath, options);
4
      return WorkbenchHelper.attributes(platformResourcePath, options);
5
    }
5
    }
6
    else
6
    else
7
    {
7
    {
8
      URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
8
      URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
9
      return resolvedLocation != null && getURIConverter(options).exists(resolvedLocation, options);
9
      return resolvedLocation == null ? Collections.<String, Object>emptyMap() : getURIConverter(options).getAttributes(resolvedLocation, options);
10
    }
10
    }
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.1
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String platformResourcePath = uri.toPlatformString(true);
    1
    String platformResourcePath = uri.toPlatformString(true);
    2
    if (workspaceRoot != null)
    2
    if (workspaceRoot != null)
                                                                                                                                          
    3
    return WorkbenchHelper.attributes(platformResourcePath, options);
    Preondition Violations
    Unmatched statement return WorkbenchHelper.attributes(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return WorkbenchHelper.attributes(platformResourcePath,options);
    3
    return WorkbenchHelper.attributes(platformResourcePath, options);
    3
    return WorkbenchHelper.exists(platformResourcePath, options);
    3
    return WorkbenchHelper.exists(platformResourcePath, options);
    Preondition Violations
    Unmatched statement return WorkbenchHelper.exists(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return WorkbenchHelper.exists(platformResourcePath,options);
                                                                                                                                  
    else
    else
    4
    URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
    4
    URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
                                                                                                                                                                                                                                                                                                
    5
    return resolvedLocation == null ? Collections.<String, Object>emptyMap() : getURIConverter(options).getAttributes(resolvedLocation, options);
    5
    return resolvedLocation != null && getURIConverter(options).exists(resolvedLocation, options);
                                                                                                                                                                                                    
    Precondition Violations (5)
    Row Violation
    1Unmatched statement return WorkbenchHelper.attributes(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return WorkbenchHelper.attributes(platformResourcePath,options);
    3Unmatched statement return WorkbenchHelper.exists(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return WorkbenchHelper.exists(platformResourcePath,options);
    5Clone fragment #1 returns variables platformResourcePath, resolvedLocation , while Clone fragment #2 returns variables platformResourcePath, resolvedLocation