List<?> data = ((Diagnostic)object).getData(); if (data != null) { for (Object datum : data) { if (datum instanceof ResourceSet) { deleteMarkers(datum, includeSubtypes, depth); return; } } }
List<?> data = ((Diagnostic)object).getData(); if (data != null) { for (Object datum : data) { if (datum instanceof ResourceSet) { return hasMarkers(datum, includeSubtypes, depth); } } }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/util/EditUIMarkerHelper.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/util/EditUIMarkerHelper.java
Method name: void deleteMarkers(Object, boolean, int) Method name: boolean hasMarkers(Object, boolean, int)
Number of AST nodes: 6 Number of AST nodes: 5
1
List<?> data = ((Diagnostic)object).getData();
1
List<?> data = ((Diagnostic)object).getData();
2
      if (data != null)
2
      if (data != null)
3
      {
3
      {
4
        for (Object datum : data)
4
        for (Object datum : data)
5
        {
5
        {
6
          if (datum instanceof ResourceSet)
6
          if (datum instanceof ResourceSet)
7
          {
7
          {
8
            deleteMarkers(datum, includeSubtypes, depth); 
8
            return hasMarkers(datum, includeSubtypes, depth); 
9
            return;
10
          }
9
          }
11
        }
10
        }
12
      }
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 declared in the same class
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 fragment1
    Time elapsed for statement mapping (ms)0.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    10
    if (datum instanceof ResourceSet)
    12
    if (datum instanceof ResourceSet)
    11
    deleteMarkers(datum, includeSubtypes, depth);
    11
    deleteMarkers(datum, includeSubtypes, depth);
    Preondition Violations
    Unmatched statement deleteMarkers(datum,includeSubtypes,depth); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                  
    12
    return;
    12
    return;
    Preondition Violations
    Unmatched return;
                          
                                                                                                          
    13
    return hasMarkers(datum, includeSubtypes, depth);
    Preondition Violations
    Unmatched statement return hasMarkers(datum,includeSubtypes,depth); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return hasMarkers(datum,includeSubtypes,depth);
    13
    return hasMarkers(datum, includeSubtypes, depth);
    Precondition Violations (4)
    Row Violation
    1Unmatched statement deleteMarkers(datum,includeSubtypes,depth); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return;
    3Unmatched statement return hasMarkers(datum,includeSubtypes,depth); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return hasMarkers(datum,includeSubtypes,depth);