if (length == -1) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { eAnnotation.getDetails().remove("maxLength"); } } else { EAnnotation eAnnotation = getAnnotation(eDataType, true); eAnnotation.getDetails().put("maxLength", Integer.toString(length)); } getExtendedMetaData(eDataType).setMaxLengthFacet(length);
if (digits == -1) { EAnnotation eAnnotation = getAnnotation(eDataType, false); if (eAnnotation != null) { eAnnotation.getDetails().remove("fractionDigits"); } } else { EAnnotation eAnnotation = getAnnotation(eDataType, true); eAnnotation.getDetails().put("fractionDigits", Integer.toString(digits)); } getExtendedMetaData(eDataType).setFractionDigitsFacet(digits);
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 setMaxLengthFacet(EDataType, int) Method name: void setFractionDigitsFacet(EDataType, int)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (length == -1)
1
if (digits == -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("maxLength");
6
        eAnnotation.getDetails().remove("fractionDigits");
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("maxLength", Integer.toString(length));
12
      eAnnotation.getDetails().put("fractionDigits", Integer.toString(digits));
13
    } 
13
    } 
14
    getExtendedMetaData(eDataType).setMaxLengthFacet(length);
14
    getExtendedMetaData(eDataType).setFractionDigitsFacet(digits);
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)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (length == -1)
    1
    if (length == -1)
    1
    if (digits == -1)
    Differences
    Expression1Expression2Difference
    lengthdigitsVARIABLE_NAME_MISMATCH
    1
    if (digits == -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("maxLength");
    4
    eAnnotation.getDetails().remove("maxLength");
    4
    eAnnotation.getDetails().remove("fractionDigits");
    Differences
    Expression1Expression2Difference
    "maxLength""fractionDigits"LITERAL_VALUE_MISMATCH
    4
    eAnnotation.getDetails().remove("fractionDigits");
    else
    else
    5
    EAnnotation eAnnotation = getAnnotation(eDataType, true);
    5
    EAnnotation eAnnotation = getAnnotation(eDataType, true);
    6
    eAnnotation.getDetails().put("maxLength", Integer.toString(length));
    6
    eAnnotation.getDetails().put("maxLength", Integer.toString(length));
    6
    eAnnotation.getDetails().put("fractionDigits", Integer.toString(digits));
    Differences
    Expression1Expression2Difference
    "maxLength""fractionDigits"LITERAL_VALUE_MISMATCH
    lengthdigitsVARIABLE_NAME_MISMATCH
    6
    eAnnotation.getDetails().put("fractionDigits", Integer.toString(digits));
    7
    getExtendedMetaData(eDataType).setMaxLengthFacet(length);
    7
    getExtendedMetaData(eDataType).setMaxLengthFacet(length);
    7
    getExtendedMetaData(eDataType).setFractionDigitsFacet(digits);
    Differences
    Expression1Expression2Difference
    setMaxLengthFacetsetFractionDigitsFacetMETHOD_INVOCATION_NAME_MISMATCH
    lengthdigitsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getExtendedMetaData(eDataType).setMaxLengthFacet(length) is a void method call, and thus it cannot be parameterized
    Expression getExtendedMetaData(eDataType).setFractionDigitsFacet(digits) is a void method call, and thus it cannot be parameterized
    7
    getExtendedMetaData(eDataType).setFractionDigitsFacet(digits);
    Precondition Violations (2)
    Row Violation
    1Expression getExtendedMetaData(eDataType).setMaxLengthFacet(length) is a void method call, and thus it cannot be parameterized
    2Expression getExtendedMetaData(eDataType).setFractionDigitsFacet(digits) is a void method call, and thus it cannot be parameterized