GenAnnotation nestedGenAnnotation = genModelAnnotation.getGenAnnotation(GENANNOTATION_SOURCE_SELECTED_REFERENCES); if (nestedGenAnnotation != null) { changed |= genModelAnnotation.getGenAnnotations().remove(nestedGenAnnotation); }
ISelectionProvider selectionProvider = workbenchPart.getSite().getSelectionProvider(); if (selectionProvider != null) { selectionProvider.addSelectionChangedListener(this); handleSelection(selectionProvider.getSelection()); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/exporter/ModelExporter.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/action/DelegatingCommandAction.java
Method name: boolean saveExporter() Method name: void registerSelectionListener(IWorkbenchPart)
Number of AST nodes: 3 Number of AST nodes: 4
1
GenAnnotation nestedGenAnnotation = genModelAnnotation.getGenAnnotation(GENANNOTATION_SOURCE_SELECTED_REFERENCES);
1
ISelectionProvider selectionProvider = workbenchPart.getSite().getSelectionProvider();
2
        if (nestedGenAnnotation != null)
2
    if (selectionProvider != null)
3
    
3
 
4
    {
4
    {
5
          changed |= genModelAnnotation.getGenAnnotations().remove(nestedGenAnnota
5
      selectionProvider.addSelectionChangedListener(this);
6
tion);
6
      handleSelection(selectionProvider.getSelection());
7
        }
7
    }
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 in different classes
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                  
    1
    ISelectionProvider selectionProvider = workbenchPart.getSite().getSelectionProvider();
    37
    GenAnnotation nestedGenAnnotation = genModelAnnotation.getGenAnnotation(GENANNOTATION_SOURCE_SELECTED_REFERENCES);
                                                                                                                                                                                                                                            
    38
    if (nestedGenAnnotation != null)
    38
    if (nestedGenAnnotation != null)
    2
    if (selectionProvider != null)
    Differences
    Expression1Expression2Difference
    nestedGenAnnotationselectionProviderVARIABLE_NAME_MISMATCH
    org.eclipse.emf.codegen.ecore.genmodel.GenAnnotationorg.eclipse.jface.viewers.ISelectionProviderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation of variable nestedGenAnnotation does not match with type org.eclipse.jface.viewers.ISelectionProvider of variable selectionProvider
    • Make classes org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation and org.eclipse.jface.viewers.ISelectionProvider extend a common superclass
    2
    if (selectionProvider != null)
                                                                                                                  
    3
    selectionProvider.addSelectionChangedListener(this);
                                                                                                              
    4
    handleSelection(selectionProvider.getSelection());
    39
    changed |= genModelAnnotation.getGenAnnotations().remove(nestedGenAnnotation);
                                                                                                                                                                    
    Precondition Violations (1)
    Row Violation
    1Type org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation of variable nestedGenAnnotation does not match with type org.eclipse.jface.viewers.ISelectionProvider of variable selectionProvider