if (literal == null) { for (EEnumLiteral eEnumLiteral : getELiterals()) { if (eEnumLiteral.getLiteral() == null) { return eEnumLiteral; } } } else { for (EEnumLiteral eEnumLiteral : getELiterals()) { if (literal.equals(eEnumLiteral.getLiteral())) { return eEnumLiteral; } } } return null;
if (source == null) { for (EAnnotation eAnnotation : eAnnotations) { if (eAnnotation.getSource() == null) { return eAnnotation; } } } else { for (EAnnotation eAnnotation : eAnnotations) { if (source.equals(eAnnotation.getSource())) { return eAnnotation; } } }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EEnumImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EModelElementImpl.java
Method name: EEnumLiteral getEEnumLiteralByLiteral(String) Method name: EAnnotation getEAnnotation(String)
Number of AST nodes: 8 Number of AST nodes: 7
1
if (literal == null)
1
if (source == null)
2
    {
2
    
3
    {
3
      for (EEnumLiteral eEnumLiteral : getELiterals())
4
          for (EAnnotation eAnnotation : eAnnotations)
4
      {
5
          {
5
        if (eEnumLiteral.getLiteral() == null)
6
            if (eAnnotation.getSource() == null)
6
        {
7
        
8
    {
7
          return eEnumLiteral;
9
              return e
10
Annotation;
8
        }
11
          
12
  }
9
      }
13
          }
10
    }
14
        }
11
    else
15
        else
12
    {
16
        {
13
      for (EEnumLiteral eEnumLiteral : getELiterals())
17
          for (EAnnotation eAnnotation : eAnnotations)
14
      {
18
       
19
   {
15
        if (literal.equals(eEnumLiteral.getLiteral()))
20
            if (source.equals(eAnnotation.getSource()))
16
        {
21
        
22
    {
17
          return eEnumLiteral;
23
              return e
24
Annotation;
18
        }
25
            }
19
      }
26
      
20
    }
27
    }
21
    return null;
28
        }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes having the same super class
Number of node comparisons4