int result = 0; if (this.source != null) { if (this.extract == TableOrder.BY_ROW) { result = this.source.getColumnCount(); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getRowCount(); } } return result;
if (this.source != null) { if (this.extract == TableOrder.BY_ROW) { result = this.source.getColumnIndex(key); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getRowIndex(key); } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/category/CategoryToPieDataset.java File path: /jfreechart-1.0.10/src/org/jfree/data/category/CategoryToPieDataset.java
Method name: int getItemCount() Method name: int getIndex(Comparable)
Number of AST nodes: 7 Number of AST nodes: 5
1
int result = 0;
2
        if (this.source != null) {
1
if (this.source != null) {
3
            if (this.extract == TableOrder.BY_ROW) {
2
            if (this.extract == TableOrder.BY_ROW) {
4
                result = this.source.getColumnCount();
3
                result = this.source.getColumnIndex(key);
5
            }
4
            }
6
            else if (this.extract == TableOrder.BY_COLUMN) {
5
            else if (this.extract == TableOrder.BY_COLUMN) {
7
                result = this.source.getRowCount();
6
                result = this.source.getRowIndex(key);
8
            }
7
            }
9
        }
8
        }
10
        return result;
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.4
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    int result = 0;
                                    
    2
    if (this.source != null)
    2
    if (this.source != null)
    3
    if (this.extract == TableOrder.BY_ROW)
    3
    if (this.extract == TableOrder.BY_ROW)
    4
    result = this.source.getColumnCount();
    4
    result = this.source.getColumnCount();
    4
    result = this.source.getColumnIndex(key);
    Differences
    Expression1Expression2Difference
    getColumnCountgetColumnIndexMETHOD_INVOCATION_NAME_MISMATCH
    this.source.getColumnCount()this.source.getColumnIndex(key)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression this.source.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.source.getColumnIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.source.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.source.getColumnIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    result = this.source.getColumnIndex(key);
    5
    else if (this.extract == TableOrder.BY_COLUMN)
    5
    else if (this.extract == TableOrder.BY_COLUMN)
    6
    result = this.source.getRowCount();
    6
    result = this.source.getRowCount();
    6
    result = this.source.getRowIndex(key);
    Differences
    Expression1Expression2Difference
    getRowCountgetRowIndexMETHOD_INVOCATION_NAME_MISMATCH
    this.source.getRowCount()this.source.getRowIndex(key)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression this.source.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.source.getRowIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.source.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.source.getRowIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    result = this.source.getRowIndex(key);
    7
    return result;
    7
    return result;
    Preondition Violations
    Unmatched statement return result; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return result;
                                      
    Precondition Violations (10)
    Row Violation
    1Expression this.source.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.source.getColumnIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression this.source.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.source.getColumnIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.source.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression this.source.getRowIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression this.source.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression this.source.getRowIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Unmatched statement return result; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Unmatched return result;