if (length == -1) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { eAnnotation.getDetails().remove("minLength"); } } else { EAnnotation eAnnotation = getAnnotation(eDataType, true); eAnnotation.getDetails().put("minLength", Integer.toString(length)); } getExtendedMetaData(eDataType).setMinLengthFacet(length);
if (length == -1) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { eAnnotation.getDetails().remove("length"); } } else { EAnnotation eAnnotation = getAnnotation(eDataType, true); eAnnotation.getDetails().put("length", Integer.toString(length)); } getExtendedMetaData(eDataType).setLengthFacet(length);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
Method name: void setMinLengthFacet(EDataType, int) Method name: void setLengthFacet(EDataType, int)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (length == -1)
1
if (length == -1)
2
    {
2
    {
3
      EAnnotation eAnnotation = getAnnotation(eDataType, false);
3
      EAnnotation eAnnotation = getAnnotation(eDataType, false);
4
      if (eAnnotation != null)
4
      if (eAnnotation != null)
5
      {
5
      {
6
        eAnnotation.getDetails().remove("minLength");
6
        eAnnotation.getDetails().remove("length");
7
      }
7
      }
8
    }
8
    }
9
    else
9
    else
10
    {
10
    {
11
      EAnnotation eAnnotation = getAnnotation(eDataType, true);
11
      EAnnotation eAnnotation = getAnnotation(eDataType, true);
12
      eAnnotation.getDetails().put("minLength", Integer.toString(length));
12
      eAnnotation.getDetails().put("length", Integer.toString(length));
13
    } 
13
    } 
14
    getExtendedMetaData(eDataType).setMinLengthFacet(length);
14
    getExtendedMetaData(eDataType).setLengthFacet(length);
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.2
Clones locationClones are declared in the same class
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (length == -1)
    1
    if (length == -1)
    2
    EAnnotation eAnnotation = getAnnotation(eDataType, false);
    2
    EAnnotation eAnnotation = getAnnotation(eDataType, false);
    3
    if (eAnnotation != null)
    3
    if (eAnnotation != null)
    4
    eAnnotation.getDetails().remove("minLength");
    4
    eAnnotation.getDetails().remove("minLength");
    4
    eAnnotation.getDetails().remove("length");
    Differences
    Expression1Expression2Difference
    "minLength""length"LITERAL_VALUE_MISMATCH
    4
    eAnnotation.getDetails().remove("length");
    else
    else
    5
    EAnnotation eAnnotation = getAnnotation(eDataType, true);
    5
    EAnnotation eAnnotation = getAnnotation(eDataType, true);
    6
    eAnnotation.getDetails().put("minLength", Integer.toString(length));
    6
    eAnnotation.getDetails().put("minLength", Integer.toString(length));
    6
    eAnnotation.getDetails().put("length", Integer.toString(length));
    Differences
    Expression1Expression2Difference
    "minLength""length"LITERAL_VALUE_MISMATCH
    6
    eAnnotation.getDetails().put("length", Integer.toString(length));
    7
    getExtendedMetaData(eDataType).setMinLengthFacet(length);
    7
    getExtendedMetaData(eDataType).setMinLengthFacet(length);
    7
    getExtendedMetaData(eDataType).setLengthFacet(length);
    Differences
    Expression1Expression2Difference
    setMinLengthFacetsetLengthFacetMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getExtendedMetaData(eDataType).setMinLengthFacet(length) is a void method call, and thus it cannot be parameterized
    Expression getExtendedMetaData(eDataType).setLengthFacet(length) is a void method call, and thus it cannot be parameterized
    7
    getExtendedMetaData(eDataType).setLengthFacet(length);
    Precondition Violations (2)
    Row Violation
    1Expression getExtendedMetaData(eDataType).setMinLengthFacet(length) is a void method call, and thus it cannot be parameterized
    2Expression getExtendedMetaData(eDataType).setLengthFacet(length) is a void method call, and thus it cannot be parameterized