for (int item = 0; item < itemCount; item++) { double lvalue = ixyd.getStartYValue(series, item); double uvalue = ixyd.getEndYValue(series, item); if (!Double.isNaN(lvalue)) { minimum = Math.min(minimum, lvalue); } if (!Double.isNaN(uvalue)) { maximum = Math.max(maximum, uvalue); } }
for (int series = 0; series < seriesCount; series++) { int itemCount = dataset.getItemCount(series); for (int item = 0; item < itemCount; item++) { double value = dataset.getYValue(series, item); if (!Double.isNaN(value)) { minimum = Math.min(minimum, value); maximum = Math.max(maximum, value); } } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java
Method name: Range iterateRangeBounds(XYDataset, boolean) Method name: Range iterateRangeBounds(XYDataset, boolean)
Number of AST nodes: 7 Number of AST nodes: 7
1
for (int item = 0; item < itemCount; item++) {
1
for (int series = 0; series < seriesCount; series++) {
2
                    double lvalue = ixyd.getStartYValue(series, item);
2
                int itemCount = dataset.getItemCount(series);
3
                for (int item = 0; item < itemCount; item++) {
3
                    double uvalue = ixyd.getEndYValue(series, item);
4
                    double value = dataset.getYValue(series, item);
4
                    if (!Double.isNaN(lvalue)) {
5
                    if (!Double.isNaN(value)) {
5
                        minimum = Math.min(minimum, lvalue);
6
                        minimum = Math.min(minimum, value);
6
                    }
7
                    if (!Double.isNaN(uvalue)) {
8
                        maximum = Math.max(maximum, uvalue);
7
                        maximum = Math.max(maximum, value);
9
                    }
8
                    }
10
                }
9
                }
10
            }
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 in the same method
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3182.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                  
    27
    int itemCount = dataset.getItemCount(series);
    Preondition Violations
    Unmatched statement int itemCount=dataset.getItemCount(series); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    27
    int itemCount = dataset.getItemCount(series);
    8
    for (int item = 0; item < itemCount; item++)
    28
    for (int item = 0; item < itemCount; item++)
    9
    double lvalue = ixyd.getStartYValue(series, item);
    9
    double lvalue = ixyd.getStartYValue(series, item);
    Preondition Violations
    Unmatched statement double lvalue=ixyd.getStartYValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement double lvalue=ixyd.getStartYValue(series,item); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                        
    10
    double uvalue = ixyd.getEndYValue(series, item);
    10
    double uvalue = ixyd.getEndYValue(series, item);
    29
    double value = dataset.getYValue(series, item);
    Differences
    Expression1Expression2Difference
    uvaluevalueVARIABLE_NAME_MISMATCH
    getEndYValuegetYValueMETHOD_INVOCATION_NAME_MISMATCH
    ixyddatasetVARIABLE_NAME_MISMATCH
    org.jfree.data.xy.IntervalXYDatasetorg.jfree.data.xy.XYDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression uvalue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ixyd.getEndYValue(series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataset.getYValue(series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ixyd cannot be unified with expression dataset , because common superclass org.jfree.data.xy.XYDataset does not declare member(s) public abstract double getEndYValue(int, int)
    29
    double value = dataset.getYValue(series, item);
    11
    if (!Double.isNaN(lvalue))
    11
    if (!Double.isNaN(lvalue))
    30
    if (!Double.isNaN(value))
    Differences
    Expression1Expression2Difference
    lvaluevalueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression lvalue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30
    if (!Double.isNaN(value))
    12
    minimum = Math.min(minimum, lvalue);
    12
    minimum = Math.min(minimum, lvalue);
    31
    minimum = Math.min(minimum, value);
    Differences
    Expression1Expression2Difference
    lvaluevalueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression lvalue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    31
    minimum = Math.min(minimum, value);
                                                                            
    32
    maximum = Math.max(maximum, value);
    Preondition Violations
    Unmatched statement maximum=Math.max(maximum,value); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    32
    maximum = Math.max(maximum, value);
    13
    if (!Double.isNaN(uvalue))
    13
    if (!Double.isNaN(uvalue))
    Preondition Violations
    Unmatched statement if(!Double.isNaN(uvalue)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                              
    14
    maximum = Math.max(maximum, uvalue);
    14
    maximum = Math.max(maximum, uvalue);
    Preondition Violations
    Unmatched statement maximum=Math.max(maximum,uvalue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                              
    Precondition Violations (16)
    Row Violation
    1Unmatched statement int itemCount=dataset.getItemCount(series); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement double lvalue=ixyd.getStartYValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement double lvalue=ixyd.getStartYValue(series,item); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    4Expression uvalue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ixyd.getEndYValue(series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression dataset.getYValue(series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression ixyd cannot be unified with expression dataset , because common superclass org.jfree.data.xy.XYDataset does not declare member(s) public abstract double getEndYValue(int, int)
    9Expression lvalue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression lvalue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Unmatched statement maximum=Math.max(maximum,value); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14Unmatched statement if(!Double.isNaN(uvalue)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15Unmatched statement maximum=Math.max(maximum,uvalue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    16Clone fragment #1 returns variables item, uvalue, minimum , while Clone fragment #2 returns variables value, minimum