Object result = values == null ? valueInternalEList == null ? valueList.get(--valueListIndex) : valueInternalEList.basicGet(--valueListIndex) : values.previous(); if (isHandlingFeatureMap) { FeatureMap.Entry entry = (FeatureMap.Entry)result; preparedFeature = entry.getEStructuralFeature(); @SuppressWarnings("unchecked") E newPreparedResult = (E)entry.getValue(); preparedResult = newPreparedResult; } else { @SuppressWarnings("unchecked") E newPreparedResult = (E)result; preparedResult = newPreparedResult; preparedFeature = feature; } prepared = -3; return true;
Object result = values == null ? valueInternalEList == null ? valueList.get(valueListIndex++) : valueInternalEList.basicGet(valueListIndex++) : values.next(); if (isHandlingFeatureMap) { FeatureMap.Entry entry = (FeatureMap.Entry)result; preparedFeature = entry.getEStructuralFeature(); @SuppressWarnings("unchecked") E newPreparedResult = (E)entry.getValue(); preparedResult = newPreparedResult; } else { @SuppressWarnings("unchecked") E newPreparedResult = (E)result; preparedResult = newPreparedResult; preparedFeature = feature; } prepared = 3; return true;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentsEList.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentsEList.java
Method name: boolean hasPrevious() Method name: boolean hasNext()
Number of AST nodes: 11 Number of AST nodes: 11
1
Object result =
1
Object result =
2
 
2
                      values == null ? 
3
                       values == null ? 
3
                        valueInternalEList == null ? 
4
                         valueInternalEList == null ? 
4
                          valueList.get(--valueListIndex) : 
5
                           valueList.get(valueListIndex++) : 
5
                          valueInternalEList.basicGet(--valueListIndex) : 
6
                           valueInternalEList.basicGet(valueListIndex++) : 
6
                        values.previous();
7
                         values.next();
7
                    if (isHandlingFeatureMap)
8
                    if (isHandlingFeatureMap)
8
                    {
9
                    {
9
                      FeatureMap.Entry entry = (FeatureMap.Entry)result; 
10
                      FeatureMap.Entry entry = (FeatureMap.Entry)result; 
10
                      preparedFeature = entry.getEStructuralFeature();
11
                      preparedFeature = entry.getEStructuralFeature();
11
                      @SuppressWarnings("unchecked") E newPreparedResult = (E)entry.getValue();
12
                      @SuppressWarnings("unchecked") E newPreparedResult = (E)entry.getValue();
12
                      preparedResult = newPreparedResult;
13
                      preparedResult = newPreparedResult;
13
                    }
14
                    }
14
                    else
15
                    else
15
                    {
16
                    {
16
                      @SuppressWarnings("unchecked") E newPreparedResult = (E)result;
17
                      @SuppressWarnings("unchecked") E newPreparedResult = (E)result;
17
                      preparedResult = newPreparedResult;
18
                      preparedResult = newPreparedResult;
18
                      preparedFeature = feature;
19
                      preparedFeature = feature;
19
                    }
20
                    }
20
                    prepared = -3;
21
                    prepared = 3;
21
                    return true;
22
                    return true;
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.3
Clones locationClones are declared in the same class
Number of node comparisons75
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    29
    Object result = values == null ? valueInternalEList == null ? valueList.get(--valueListIndex) : valueInternalEList.basicGet(--valueListIndex) : values.previous();
    29
    Object result = values == null ? valueInternalEList == null ? valueList.get(--valueListIndex) : valueInternalEList.basicGet(--valueListIndex) : values.previous();
    Preondition Violations
    Unmatched statement Object result=values == null ? valueInternalEList == null ? valueList.get(--valueListIndex) : valueInternalEList.basicGet(--valueListIndex) : values.previous(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                                    
    30
    Object result = values == null ? valueInternalEList == null ? valueList.get(valueListIndex++) : valueInternalEList.basicGet(valueListIndex++) : values.next();
    Preondition Violations
    Unmatched statement Object result=values == null ? valueInternalEList == null ? valueList.get(valueListIndex++) : valueInternalEList.basicGet(valueListIndex++) : values.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    30
    Object result = values == null ? valueInternalEList == null ? valueList.get(valueListIndex++) : valueInternalEList.basicGet(valueListIndex++) : values.next();
    30
    if (isHandlingFeatureMap)
    31
    if (isHandlingFeatureMap)
    31
    FeatureMap.Entry entry = (FeatureMap.Entry)result;
    32
    FeatureMap.Entry entry = (FeatureMap.Entry)result;
    32
    preparedFeature = entry.getEStructuralFeature();
    33
    preparedFeature = entry.getEStructuralFeature();
    33
    @SuppressWarnings("unchecked") E newPreparedResult = (E)entry.getValue();
    34
    @SuppressWarnings("unchecked") E newPreparedResult = (E)entry.getValue();
    34
    preparedResult = newPreparedResult;
    35
    preparedResult = newPreparedResult;
    else
    else
    35
    @SuppressWarnings("unchecked") E newPreparedResult = (E)result;
    36
    @SuppressWarnings("unchecked") E newPreparedResult = (E)result;
    36
    preparedResult = newPreparedResult;
    37
    preparedResult = newPreparedResult;
    37
    preparedFeature = feature;
    38
    preparedFeature = feature;
    38
    prepared = -3;
    38
    prepared = -3;
    39
    prepared = 3;
    Differences
    Expression1Expression2Difference
    -33TYPE_COMPATIBLE_REPLACEMENT
    39
    prepared = 3;
    39
    return true;
    39
    return true;
    40
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    40
    return true;
    Precondition Violations (4)
    Row Violation
    1Unmatched statement Object result=values == null ? valueInternalEList == null ? valueList.get(--valueListIndex) : valueInternalEList.basicGet(--valueListIndex) : values.previous(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Object result=values == null ? valueInternalEList == null ? valueList.get(valueListIndex++) : valueInternalEList.basicGet(valueListIndex++) : values.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Conditional return true;
    4Conditional return true;