if (workspaceRoot != null) { return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath); } else // ECLIPSE-DEPEND-END { URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath); if (resolvedLocation != null) { return createOutputStream(resolvedLocation); } throw new IOException("The path '" + platformResourcePath + "' is unmapped"); }
if (workspaceRoot != null) { return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath); } else // ECLIPSE-DEPEND-END { URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath); if (resolvedLocation != null) { return createInputStream(resolvedLocation); } 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/URIConverterImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/URIConverterImpl.java
Method name: OutputStream createPlatformResourceOutputStream(String) Method name: InputStream createPlatformResourceInputStream(String)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (workspaceRoot != null)
1
if (workspaceRoot != null)
2
    {
2
    {
3
      return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath);
3
      return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath);
4
    }
4
    }
5
    else
5
    else
6
    // ECLIPSE-DEPEND-END
6
    // ECLIPSE-DEPEND-END
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 createOutputStream(resolvedLocation);
11
        return createInputStream(resolvedLocation);
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 comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (workspaceRoot != null)
    1
    if (workspaceRoot != null)
                                                                                                                                                                        
    2
    return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath);
    Preondition Violations
    Unmatched return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath);
    2
    return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath);
    2
    return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath);
    2
    return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath);
    Preondition Violations
    Unmatched return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath);
                                                                                                                                                                          
    else
    else
    3
    URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
    3
    URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);
    4
    if (resolvedLocation != null)
    4
    if (resolvedLocation != null)
                                                                                                
    5
    return createInputStream(resolvedLocation);
    Preondition Violations
    Unmatched statement return createInputStream(resolvedLocation); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return createInputStream(resolvedLocation);
    5
    return createInputStream(resolvedLocation);
    5
    return createOutputStream(resolvedLocation);
    5
    return createOutputStream(resolvedLocation);
    Preondition Violations
    Unmatched statement return createOutputStream(resolvedLocation); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return createOutputStream(resolvedLocation);
                                                                                                  
    6
    throw new IOException("The path '" + platformResourcePath + "' is unmapped");
    6
    throw new IOException("The path '" + platformResourcePath + "' is unmapped");
    Precondition Violations (6)
    Row Violation
    1Unmatched return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath);
    2Unmatched return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath);
    3Unmatched statement return createInputStream(resolvedLocation); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return createInputStream(resolvedLocation);
    5Unmatched statement return createOutputStream(resolvedLocation); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return createOutputStream(resolvedLocation);