1135-1-2

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();

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 7

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 2
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 0.4
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       if (range == null)

   1 | if (range == null)
   1 | if (pieChart == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   range | pieChart | VARIABLE_NAME_MISMATCH
   org.jfree.data.Range | org.jfree.chart.JFreeChart | VARIABLE_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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "Null 'range' argument." | "Null 'pieChart' argument." | LITERAL_VALUE_MISMATCH

   2

       throw new IllegalArgumentException("Null 'pieChart' argument.");

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Type org.jfree.data.Range of variable range does not match with type org.jfree.chart.JFreeChart of variable pieChart