if (diagnostics != null && !result) { diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_OPPOSITE_BAD_TRANSIENT, "_UI_EReferenceTransientOppositeNotTransient_diagnostic", null, new Object[] { eReference, eOpposite }, context)); }
if (diagnostics != null && !result) { diagnostics.add (createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_OPPOSITE_BOTH_CONTAINMENT, "_UI_EReferenceOppositeBothContainment_diagnostic", null, new Object[] { eReference, eOpposite }, context)); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java
Method name: boolean validateEReference_ConsistentOpposite(EReference, DiagnosticChain, Map) Method name: boolean validateEReference_ConsistentOpposite(EReference, DiagnosticChain, Map)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (diagnostics != null && !result)
1
if (diagnostics != null && !result)
2
        {
2
        {
3
          diagnostics.add
3
          diagnostics.add
4
            (createDiagnostic
4
            (createDiagnostic
5
              (Diagnostic.ERROR,
5
              (Diagnostic.ERROR,
6
               DIAGNOSTIC_SOURCE,
6
               DIAGNOSTIC_SOURCE,
7
               CONSISTENT_OPPOSITE_BAD_TRANSIENT,
7
               CONSISTENT_OPPOSITE_BOTH_CONTAINMENT,
8
               "_UI_EReferenceTransientOppositeNotTransient_diagnostic",
8
               "_UI_EReferenceOppositeBothContainment_diagnostic",
9
               null,
9
               null,
10
               new Object[] { eReference, eOpposite },
10
               new Object[] { eReference, eOpposite },
11
               context));
11
               context));
12
        }
12
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    21
    if (diagnostics != null && !result)
    25
    if (diagnostics != null && !result)
    22
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_OPPOSITE_BAD_TRANSIENT, "_UI_EReferenceTransientOppositeNotTransient_diagnostic", null, new Object[] {eReference, eOpposite}, context));
    22
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_OPPOSITE_BAD_TRANSIENT, "_UI_EReferenceTransientOppositeNotTransient_diagnostic", null, new Object[] {eReference, eOpposite}, context));
    26
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_OPPOSITE_BOTH_CONTAINMENT, "_UI_EReferenceOppositeBothContainment_diagnostic", null, new Object[] {eReference, eOpposite}, context));
    Differences
    Expression1Expression2Difference
    CONSISTENT_OPPOSITE_BAD_TRANSIENTCONSISTENT_OPPOSITE_BOTH_CONTAINMENTVARIABLE_NAME_MISMATCH
    "_UI_EReferenceTransientOppositeNotTransient_diagnostic""_UI_EReferenceOppositeBothContainment_diagnostic"LITERAL_VALUE_MISMATCH
    26
    diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, CONSISTENT_OPPOSITE_BOTH_CONTAINMENT, "_UI_EReferenceOppositeBothContainment_diagnostic", null, new Object[] {eReference, eOpposite}, context));
    Precondition Violations (0)
    Row Violation