if (canvas != null) { canvas.dispose(); canvas = null; super.dismiss(); // setEditor(null, null, -1); }
if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, getString(key, substitutions), new Object [] { index })); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/celleditor/AdapterFactoryTableTreeEditor.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java
Method name: void dismiss() Method name: void report(DiagnosticChain, String, Object[], int, Map)
Number of AST nodes: 4 Number of AST nodes: 2
1
if (canvas != null)
1
if (diagnostics != null)
2
    {
2
    {
3
      canvas.dispose();
3
      
4
      canvas = null;
5
      super.dismiss();
6
      // setEditor(null, null, -1
4
diagnostics.add
5
        (new BasicDiagnostic
6
           (Diagnostic.ERROR,
7
            DIAGNOSTIC_SOURCE,
8
            WELL_FORMED_INSTANCE_TYPE_NAME,
9
            getString(key, substitutions),
7
);
10
            new Object [] { index }));
8
    }
11
    }
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 comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (canvas != null)
    1
    if (canvas != null)
    1
    if (diagnostics != null)
    Differences
    Expression1Expression2Difference
    canvasdiagnosticsVARIABLE_NAME_MISMATCH
    org.eclipse.swt.widgets.Compositeorg.eclipse.emf.common.util.DiagnosticChainVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.swt.widgets.Composite of variable canvas does not match with type org.eclipse.emf.common.util.DiagnosticChain of variable diagnostics
    • Make classes org.eclipse.swt.widgets.Composite and org.eclipse.emf.common.util.DiagnosticChain extend a common superclass
    1
    if (diagnostics != null)
    2
    canvas.dispose();
                                            
    3
    canvas = null;
                                  
    4
    super.dismiss();
    4
    super.dismiss();
    2
    diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, getString(key, substitutions), new Object[] {index}));
    Differences
    Expression1Expression2Difference
    super.dismiss()diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,WELL_FORMED_INSTANCE_TYPE_NAME,getString(key,substitutions),new Object[]{index}))TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression super.dismiss() is a void method call, and thus it cannot be parameterized
    Expression diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,WELL_FORMED_INSTANCE_TYPE_NAME,getString(key,substitutions),new Object[]{index})) is a void method call, and thus it cannot be parameterized
    2
    diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, getString(key, substitutions), new Object[] {index}));
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.swt.widgets.Composite of variable canvas does not match with type org.eclipse.emf.common.util.DiagnosticChain of variable diagnostics
    2Expression super.dismiss() is a void method call, and thus it cannot be parameterized
    3Expression diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR,DIAGNOSTIC_SOURCE,WELL_FORMED_INSTANCE_TYPE_NAME,getString(key,substitutions),new Object[]{index})) is a void method call, and thus it cannot be parameterized