String platformResourcePath = uri.toPlatformString(true); if (workspaceRoot != null) { return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath, options); } else { URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath); if (resolvedLocation != null) { return getURIConverter(options).createInputStream(resolvedLocation, options); } throw new IOException("The path '" + platformResourcePath + "' is unmapped"); }
String platformResourcePath = uri.toPlatformString(true); if (workspaceRoot != null) { return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath, options); } else { URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath); if (resolvedLocation != null) { return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation, options); } throw new IOException("The path '" + platformResourcePath + "' is unmapped"); }
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: InputStream createInputStream(URI, Map) Method name: OutputStream createOutputStream(URI, Map)
Number of AST nodes: 7 Number of AST nodes: 7
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.createPlatformResourceInputStream(platformResourcePath, options);
4
      return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath, options);
5
    }
5
    }
6
    else
6
    else
7
    {
7
    {
8
      URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
8
      URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
9
      if (resolvedLocation != null)
9
      if (resolvedLocation != null)
10
      {
10
      {
11
        return getURIConverter(options).createInputStream(resolvedLocation, options);
11
        return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation, options);
12
      }
12
      }
13
      throw new IOException("The path '" + platformResourcePath + "' is unmapped");
13
      throw new IOException("The path '" + platformResourcePath + "' is unmapped");
14
    }
14
    }
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 comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.9
    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.createPlatformResourceOutputStream(platformResourcePath, options);
    Preondition Violations
    Unmatched statement return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath,options);
    3
    return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath, options);
    3
    return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath, options);
    3
    return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath, options);
    Preondition Violations
    Unmatched statement return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath,options);
                                                                                                                                                                                        
    else
    else
    4
    URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
    4
    URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
    5
    if (resolvedLocation != null)
    5
    if (resolvedLocation != null)
                                                                                                                                                                                                                                                
    6
    return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation, options);
    Preondition Violations
    Unmatched statement return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation,options);
    6
    return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation, options);
    6
    return getURIConverter(options).createInputStream(resolvedLocation, options);
    6
    return getURIConverter(options).createInputStream(resolvedLocation, options);
    Preondition Violations
    Unmatched statement return getURIConverter(options).createInputStream(resolvedLocation,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return getURIConverter(options).createInputStream(resolvedLocation,options);
                                                                                                                                                                  
    7
    throw new IOException("The path '" + platformResourcePath + "' is unmapped");
    7
    throw new IOException("The path '" + platformResourcePath + "' is unmapped");
    Precondition Violations (9)
    Row Violation
    1Unmatched statement return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath,options);
    3Unmatched statement return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath,options);
    5Unmatched statement return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation,options);
    7Unmatched statement return getURIConverter(options).createInputStream(resolvedLocation,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched return getURIConverter(options).createInputStream(resolvedLocation,options);
    9Clone fragment #1 returns variables platformResourcePath, resolvedLocation , while Clone fragment #2 returns variables platformResourcePath, resolvedLocation