if (result == Collections.EMPTY_LIST) { result = new ArrayList<EAnnotation>(); } EAnnotation eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); result.add(eAnnotation);
if (result == Collections.EMPTY_LIST) { result = new ArrayList<EAnnotation>(); } EAnnotation eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); result.add(eAnnotation);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/java/builder/JavaEcoreBuilder.java File path: /emf-2.4.1/src/org/eclipse/emf/importer/java/builder/JavaEcoreBuilder.java
Method name: List extractEAnnotations(String) Method name: List extractEAnnotations(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (result == Collections.EMPTY_LIST)
1
if (result == Collections.EMPTY_LIST)
2
        {
2
      
3
  
3
{
4
        result = new ArrayList<EAnnotation>();
4
        result = new ArrayList<EAnnotation>();
5
        }
5
      
6
  
6
}
7
      EAnnotation eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
7
      EAnnotation eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
8
        result.add(eAnnotation);
8
      result.add(eAnnotation);
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.2
Clones locationClones are in the same method
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    5
    if (result == Collections.EMPTY_LIST)
    15
    if (result == Collections.EMPTY_LIST)
    6
    result = new ArrayList<EAnnotation>();
    16
    result = new ArrayList<EAnnotation>();
    7
    EAnnotation eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
    17
    EAnnotation eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
    8
    result.add(eAnnotation);
    18
    result.add(eAnnotation);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables eAnnotation, result , while Clone fragment #2 returns variables eAnnotation, result