boolean equal = true; InputStream oldContents = null; try { oldContents = uriConverter.createInputStream(getURI(), defaultLoadOptions); } catch (IOException exception) { equal = false; } byte [] newContentBuffer = new byte [4000];
boolean equal = true; InputStream oldContents = null; try { oldContents = uriConverter.createInputStream(getURI(), defaultLoadOptions); } catch (IOException exception) { equal = false; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java
Method name: void saveOnlyIfChangedWithFileBuffer(Map) Method name: void saveOnlyIfChangedWithMemoryBuffer(Map)
Number of AST nodes: 5 Number of AST nodes: 4
1
boolean equal = true;
1
boolean equal = true;
2
      InputStream oldContents = null;
2
    InputStream oldContents = null;
3
      try
3
    try
4
      {
4
    
5
  
5
{
6
      oldContents = uriConverter.createInputStream(getURI(), defaultLoadOptions);
6
      oldContents = uriConverter.createInputStream(getURI(), defaultLoadOptions);
7
      }
7
    }
8
      catch (IOException exception)
8
    catch (IOException exception)
9
      {
9
    
10
  
10
{
11
      equal = false;
11
      equal = false;
12
      }
12
    
13
      byte [] newContentBuffer = new byte [4000];
13
}
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    boolean equal = true;
    7
    boolean equal = true;
    9
    InputStream oldContents = null;
    8
    InputStream oldContents = null;
    10
    try
    9
    try
    11
    oldContents = uriConverter.createInputStream(getURI(), defaultLoadOptions);
    10
    oldContents = uriConverter.createInputStream(getURI(), defaultLoadOptions);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables oldContents, equal , while Clone fragment #2 returns variables oldContents, equal