if (range == null) { throw new IllegalArgumentException("Null 'range' argument."); } if (!(range.getLength() > 0.0)) { throw new IllegalArgumentException( "Range length must be positive."); } this.range = range; fireChangeEvent();
if (pieChart == null) { throw new IllegalArgumentException("Null 'pieChart' argument."); } if (!(pieChart.getPlot() instanceof PiePlot)) { throw new IllegalArgumentException("The 'pieChart' argument must " + "be a chart based on a PiePlot."); } this.pieChart = pieChart; fireChangeEvent();
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MeterPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java
Method name: void setRange(Range) Method name: void setPieChart(JFreeChart)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (range == null) {
1
if (pieChart == null) {
2
            throw new IllegalArgumentException("Null 'range' argument.");
2
            throw new IllegalArgumentException("Null 'pieChart' argument.");
3
        }
3
        }
4
        if (!(range.getLength() > 0.0)) {
4
        if (!(pieChart.getPlot() instanceof PiePlot)) {
5
            throw new IllegalArgumentException(
5
            throw new IllegalArgumentException("The 'pieChart' argument must "
6
                    "Range length must be positive.");
6
                    + "be a chart based on a PiePlot.");
7
        }
7
        }
8
        this.range = range;
8
        this.pieChart = pieChart;
9
        fireChangeEvent();
9
        fireChangeEvent();
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 in different classes having the same super class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)53.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (range == null)
    1
    if (range == null)
    1
    if (pieChart == null)
    Differences
    Expression1Expression2Difference
    rangepieChartVARIABLE_NAME_MISMATCH
    org.jfree.data.Rangeorg.jfree.chart.JFreeChartVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.data.Range of variable range does not match with type org.jfree.chart.JFreeChart of variable pieChart
    • Make classes org.jfree.data.Range and org.jfree.chart.JFreeChart extend a common superclass
    1
    if (pieChart == null)
    2
    throw new IllegalArgumentException("Null 'range' argument.");
    2
    throw new IllegalArgumentException("Null 'range' argument.");
    2
    throw new IllegalArgumentException("Null 'pieChart' argument.");
    Differences
    Expression1Expression2Difference
    "Null 'range' argument.""Null 'pieChart' argument."LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("Null 'pieChart' argument.");
    3
    if (!(range.getLength() > 0.0))
    3
    if (!(range.getLength() > 0.0))
    3
    if (!(pieChart.getPlot() instanceof PiePlot))
    Differences
    Expression1Expression2Difference
    range.getLength() > 0.0pieChart.getPlot() instanceof PiePlotTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression range.getLength() > 0.0 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pieChart.getPlot() instanceof PiePlot cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(pieChart.getPlot() instanceof PiePlot))
    4
    throw new IllegalArgumentException("Range length must be positive.");
    4
    throw new IllegalArgumentException("Range length must be positive.");
    4
    throw new IllegalArgumentException("The 'pieChart' argument must " + "be a chart based on a PiePlot.");
    Differences
    Expression1Expression2Difference
    "Range length must be positive.""The 'pieChart' argument must " + "be a chart based on a PiePlot."TYPE_COMPATIBLE_REPLACEMENT
    4
    throw new IllegalArgumentException("The 'pieChart' argument must " + "be a chart based on a PiePlot.");
                                                        
    5
    this.pieChart = pieChart;
    Preondition Violations
    Unmatched statement this.pieChart=pieChart; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    this.pieChart = pieChart;
    5
    this.range = range;
    5
    this.range = range;
    Preondition Violations
    Unmatched statement this.range=range; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                            
    6
    fireChangeEvent();
    6
    fireChangeEvent();
    Precondition Violations (5)
    Row Violation
    1Type org.jfree.data.Range of variable range does not match with type org.jfree.chart.JFreeChart of variable pieChart
    2Expression range.getLength() > 0.0 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression pieChart.getPlot() instanceof PiePlot cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched statement this.pieChart=pieChart; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement this.range=range; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted