if (errors == null) { errors = new NotifyingListImpl<Diagnostic>() { private static final long serialVersionUID = 1L; @Override protected boolean isNotificationRequired() { return ResourceImpl.this.eNotificationRequired(); } @Override public Object getNotifier() { return ResourceImpl.this; } @Override public int getFeatureID() { return RESOURCE__ERRORS; } }; } return errors;
if (warnings == null) { warnings = new NotifyingListImpl<Diagnostic>() { private static final long serialVersionUID = 1L; @Override protected boolean isNotificationRequired() { return ResourceImpl.this.eNotificationRequired(); } @Override public Object getNotifier() { return ResourceImpl.this; } @Override public int getFeatureID() { return RESOURCE__WARNINGS; } }; } return warnings;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java
Method name: EList getErrors() Method name: EList getWarnings()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (errors == null)
1
if (warnings == null)
2
    {
2
    {
3
      errors =
3
      warnings =
4
        new NotifyingListImpl<Diagnostic>()
4
        new NotifyingListImpl<Diagnostic>()
5
        {
5
        {
6
          private static final long serialVersionUID = 1L;
6
          private static final long serialVersionUID = 1L;
7
          @Override
7
          @Override
8
          protected boolean isNotificationRequired()
8
          protected boolean isNotificationRequired()
9
          {
9
          {
10
             return ResourceImpl.this.eNotificationRequired();
10
             return ResourceImpl.this.eNotificationRequired();
11
          }
11
          }
12
          @Override
12
          @Override
13
          public Object getNotifier()
13
          public Object getNotifier()
14
          {
14
          {
15
            return ResourceImpl.this;
15
            return ResourceImpl.this;
16
          }
16
          }
17
          @Override
17
          @Override
18
          public int getFeatureID()
18
          public int getFeatureID()
19
          {
19
          {
20
            return RESOURCE__ERRORS;
20
            return RESOURCE__WARNINGS;
21
          }
21
          }
22
        };
22
        };
23
    }
23
    }
24
    return errors;
24
    return warnings;
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 declared in the same class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (errors == null)
    1
    if (errors == null)
    1
    if (warnings == null)
    Differences
    Expression1Expression2Difference
    errorswarningsVARIABLE_NAME_MISMATCH
    1
    if (warnings == null)
    2
    errors = new NotifyingListImpl<Diagnostic>() {...};
    2
    errors = new NotifyingListImpl<Diagnostic>() {...};
    2
    warnings = new NotifyingListImpl<Diagnostic>() {...};
    Differences
    Expression1Expression2Difference
    errorswarningsVARIABLE_NAME_MISMATCH
    RESOURCE__ERRORSRESOURCE__WARNINGSVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression errors is a field being modified, and thus it cannot be parameterized
    Expression warnings is a field being modified, and thus it cannot be parameterized
    2
    warnings = new NotifyingListImpl<Diagnostic>() {...};
    3
    return errors;
    3
    return errors;
    3
    return warnings;
    Differences
    Expression1Expression2Difference
    errorswarningsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression errors cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression warnings cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    return warnings;
    Precondition Violations (4)
    Row Violation
    1Expression errors is a field being modified, and thus it cannot be parameterized
    2Expression warnings is a field being modified, and thus it cannot be parameterized
    3Expression errors cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression warnings cannot be parameterized, because it has dependencies to/from statements that will be extracted