int result = this.rangeAxes.indexOf(axis); if (result < 0) { // try the parent plot Plot parent = getParent(); if (parent instanceof XYPlot) { XYPlot p = (XYPlot) parent; result = p.getRangeAxisIndex(axis); } } return result;
String result = null; if (mapIndex < getListCount()) { Map urlMap = (Map) this.urls.get(mapIndex); if (urlMap != null) { result = (String) urlMap.get(key); } } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/CustomPieURLGenerator.java
Method name: int getRangeAxisIndex(ValueAxis) Method name: String getURL(Comparable, int)
Number of AST nodes: 7 Number of AST nodes: 6
1
int result = this.rangeAxes.indexOf(axis);
1
String result = 
2
        if (result < 0) {
3
            // try the parent plot
4
            Plot parent = getParent();
5
            if (parent instanceof XYPlot) {
6
                XYPlot p = (XYPlot) parent;
7
                result = p.getRangeAxisIndex(axis
2
null;
3
        if (mapIndex < getListCount()) {
4
            Map urlMap = (Map) this.urls.get(mapIndex);
5
            if (urlMap != null) {
8
);
6
                result = (String) urlMap.get(key);
9
            }
7
            }
10
        }
8
        }
11
        return result;
9
        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.1
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                
    1
    String result = null;
    1
    int result = this.rangeAxes.indexOf(axis);
                                                                                          
    2
    if (result < 0)
    2
    if (result < 0)
    2
    if (mapIndex < getListCount())
    Differences
    Expression1Expression2Difference
    resultmapIndexVARIABLE_NAME_MISMATCH
    0getListCount()TYPE_COMPATIBLE_REPLACEMENT
    2
    if (mapIndex < getListCount())
                                                                                          
    3
    Map urlMap = (Map)this.urls.get(mapIndex);
    Preondition Violations
    Unmatched statement Map urlMap=(Map)this.urls.get(mapIndex); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    Map urlMap = (Map)this.urls.get(mapIndex);
    3
    Plot parent = getParent();
                                                          
                                              
    4
    if (urlMap != null)
                                                                        
    5
    result = (String)urlMap.get(key);
    Preondition Violations
    Unmatched statement result=(String)urlMap.get(key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    result = (String)urlMap.get(key);
    4
    if (parent instanceof XYPlot)
                                                                  
    5
    XYPlot p = (XYPlot)parent;
                                                          
    6
    result = p.getRangeAxisIndex(axis);
    6
    result = p.getRangeAxisIndex(axis);
    Preondition Violations
    Unmatched statement result=p.getRangeAxisIndex(axis); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                            
                                      
    6
    return result;
    Preondition Violations
    Unmatched return result;
    6
    return result;
    7
    return result;
    7
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (6)
    Row Violation
    1Unmatched statement Map urlMap=(Map)this.urls.get(mapIndex); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement result=(String)urlMap.get(key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement result=p.getRangeAxisIndex(axis); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return result;
    5Unmatched return result;
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero