Object lowerBound = EcoreUtil.createFromString(eDataType, "-" + digits.toString()); @SuppressWarnings("unchecked") boolean lowerBounded = effectiveMin == null || (effectiveMinIsInclusive ? ((Comparable<Object>)effectiveMin).compareTo(lowerBound) <= 0: ((Comparable<Object>)effectiveMin).compareTo(lowerBound) < 0); if (lowerBounded) { effectiveMinIsInclusive = false; effectiveMin = lowerBound; effectiveTotalDigitsMin = effectiveTotalDigits; }
Object upperBound = EcoreUtil.createFromString(eDataType, digits.toString()); @SuppressWarnings("unchecked") boolean upperBounded = effectiveMax == null || (effectiveMaxIsInclusive ? ((Comparable<Object>)effectiveMax).compareTo(upperBound) >= 0: ((Comparable<Object>)effectiveMax).compareTo(upperBound) > 0); if (upperBounded) { effectiveMaxIsInclusive = false; effectiveMax = upperBound; effectiveTotalDigitsMax = effectiveTotalDigits; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EObjectValidator.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EObjectValidator.java
Method name: void DynamicEDataTypeValidator(EDataType) Method name: void DynamicEDataTypeValidator(EDataType)
Number of AST nodes: 6 Number of AST nodes: 6
1
Object lowerBound = EcoreUtil.createFromString(eDataType, "-" + digits.toString());
1
Object upperBound = EcoreUtil.createFromString(eDataType, digits.toString());
2
          @SuppressWarnings("unchecked") boolean lowerBounded = effectiveMin == null ||
2
          @SuppressWarnings("unchecked") boolean upperBounded = effectiveMax == null ||
3
                (effectiveMinIsInclusive ?
3
                (effectiveMaxIsInclusive ?
4
                   ((Comparable<Object>)effectiveMin).compareTo(lowerBound) &lt;= 0:
4
                   ((Comparable<Object>)effectiveMax).compareTo(upperBound) &gt;= 0:
5
                   ((Comparable<Object>)effectiveMin).compareTo(lowerBound) &lt; 0);
5
                   ((Comparable<Object>)effectiveMax).compareTo(upperBound) &gt; 0);
6
          if (lowerBounded)
6
          if (upperBounded)
7
          {
7
          {
8
            effectiveMinIsInclusive = false;
8
            effectiveMaxIsInclusive = false;
9
            effectiveMin = lowerBound;
9
            effectiveMax = upperBound;
10
            effectiveTotalDigitsMin = effectiveTotalDigits;
10
            effectiveTotalDigitsMax = effectiveTotalDigits;
11
          }
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 in the same method
Number of node comparisons23
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    69
    Object lowerBound = EcoreUtil.createFromString(eDataType, "-" + digits.toString());
    69
    Object lowerBound = EcoreUtil.createFromString(eDataType, "-" + digits.toString());
    76
    Object upperBound = EcoreUtil.createFromString(eDataType, digits.toString());
    Differences
    Expression1Expression2Difference
    lowerBoundupperBoundVARIABLE_NAME_MISMATCH
    "-" + digits.toString()digits.toString()TYPE_COMPATIBLE_REPLACEMENT
    76
    Object upperBound = EcoreUtil.createFromString(eDataType, digits.toString());
    71
    if (lowerBounded)
    71
    if (lowerBounded)
    78
    if (upperBounded)
    Differences
    Expression1Expression2Difference
    lowerBoundedupperBoundedVARIABLE_NAME_MISMATCH
    78
    if (upperBounded)
    72
    effectiveMinIsInclusive = false;
    72
    effectiveMinIsInclusive = false;
    79
    effectiveMaxIsInclusive = false;
    Differences
    Expression1Expression2Difference
    effectiveMinIsInclusiveeffectiveMaxIsInclusiveVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression effectiveMinIsInclusive is a field being modified, and thus it cannot be parameterized
    Expression effectiveMaxIsInclusive is a field being modified, and thus it cannot be parameterized
    79
    effectiveMaxIsInclusive = false;
    73
    effectiveMin = lowerBound;
    73
    effectiveMin = lowerBound;
    80
    effectiveMax = upperBound;
    Differences
    Expression1Expression2Difference
    effectiveMineffectiveMaxVARIABLE_NAME_MISMATCH
    lowerBoundupperBoundVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression effectiveMin is a field being modified, and thus it cannot be parameterized
    Expression effectiveMax is a field being modified, and thus it cannot be parameterized
    80
    effectiveMax = upperBound;
    74
    effectiveTotalDigitsMin = effectiveTotalDigits;
    74
    effectiveTotalDigitsMin = effectiveTotalDigits;
    81
    effectiveTotalDigitsMax = effectiveTotalDigits;
    Differences
    Expression1Expression2Difference
    effectiveTotalDigitsMineffectiveTotalDigitsMaxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression effectiveTotalDigitsMin is a field being modified, and thus it cannot be parameterized
    Expression effectiveTotalDigitsMax is a field being modified, and thus it cannot be parameterized
    81
    effectiveTotalDigitsMax = effectiveTotalDigits;
    Precondition Violations (6)
    Row Violation
    1Expression effectiveMinIsInclusive is a field being modified, and thus it cannot be parameterized
    2Expression effectiveMaxIsInclusive is a field being modified, and thus it cannot be parameterized
    3Expression effectiveMin is a field being modified, and thus it cannot be parameterized
    4Expression effectiveMax is a field being modified, and thus it cannot be parameterized
    5Expression effectiveTotalDigitsMin is a field being modified, and thus it cannot be parameterized
    6Expression effectiveTotalDigitsMax is a field being modified, and thus it cannot be parameterized