CategoryAxis result = getDomainAxis(); Integer axisIndex = (Integer) this.datasetToDomainAxisMap.get(index); if (axisIndex != null) { result = getDomainAxis(axisIndex.intValue()); } return result;
Number result = null; BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject( row, column); if (item != null) { result = item.getQ1(); } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/DefaultBoxAndWhiskerCategoryDataset.java
Method name: CategoryAxis getDomainAxisForDataset(int) Method name: Number getQ1Value(int, int)
Number of AST nodes: 5 Number of AST nodes: 5
1
CategoryAxis result = getDomainAxis();
2
        Integer axisIndex = (Integer) this.datasetToDomainAxisMap.get(index
1
Number result = null;
2
        BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(
3
);
3
                row, column);
4
        if (axisIndex != null) {
4
        if (item != null) {
5
            result = getDomainAxis(axisIndex.intValue());
5
            result = item.getQ1();
6
        }
6
        }
7
        return result;
7
        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.2
Clones locationClones are in different classes
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    CategoryAxis result = getDomainAxis();
                                                                                  
    2
    Integer axisIndex = (Integer)this.datasetToDomainAxisMap.get(index);
    2
    Integer axisIndex = (Integer)this.datasetToDomainAxisMap.get(index);
    1
    Number result = null;
    Differences
    Expression1Expression2Difference
    java.lang.Integerjava.lang.NumberSUBCLASS_TYPE_MISMATCH
    axisIndexresultVARIABLE_NAME_MISMATCH
    java.lang.Integerjava.lang.NumberSUBCLASS_TYPE_MISMATCH
    (Integer)this.datasetToDomainAxisMap.get(index)nullTYPE_COMPATIBLE_REPLACEMENT
    1
    Number result = null;
                                                                                                                                                              
    2
    BoxAndWhiskerItem item = (BoxAndWhiskerItem)this.data.getObject(row, column);
    3
    if (axisIndex != null)
    3
    if (axisIndex != null)
    3
    if (item != null)
    Differences
    Expression1Expression2Difference
    axisIndexitemVARIABLE_NAME_MISMATCH
    java.lang.Integerorg.jfree.data.statistics.BoxAndWhiskerItemVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression axisIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression item cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Integer of variable axisIndex does not match with type org.jfree.data.statistics.BoxAndWhiskerItem of variable item
    • Make classes java.lang.Integer and org.jfree.data.statistics.BoxAndWhiskerItem extend a common superclass
    3
    if (item != null)
                                                  
    4
    result = item.getQ1();
    Preondition Violations
    Unmatched statement result=item.getQ1(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    result = item.getQ1();
    4
    result = getDomainAxis(axisIndex.intValue());
    4
    result = getDomainAxis(axisIndex.intValue());
    Preondition Violations
    Unmatched statement result=getDomainAxis(axisIndex.intValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
                                      
    5
    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;
    5
    return result;
    5
    return result;
    5
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (9)
    Row Violation
    1Expression axisIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression item cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.lang.Integer of variable axisIndex does not match with type org.jfree.data.statistics.BoxAndWhiskerItem of variable item
    4Unmatched statement result=item.getQ1(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement result=getDomainAxis(axisIndex.intValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement return result; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched return result;
    8Unmatched return result;
    9Clone fragment #1 returns variable axisIndex with type java.lang.Integer , while Clone fragment #2 returns variable result with type java.lang.Number