File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedDomainXYPlotTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedRangeXYPlotTests.java | |||
Method name: CombinedDomainXYPlot createPlot()
|
Method name: CombinedRangeXYPlot createPlot()
|
|||
Number of AST nodes: 21 | Number of AST nodes: 21 | |||
1 | XYDataset data1 = createDataset1();↵ | 1 | XYDataset data1 = createDataset1();↵ | |
2 | XYItemRenderer renderer1 = new StandardXYItemRenderer();↵ | 2 | XYItemRenderer renderer1 = new StandardXYItemRenderer();↵ | |
3 | NumberAxis rangeAxis1 = new NumberAxis("Range 1");↵ | 3 | NumberAxis xAxis1 = new NumberAxis("X1");↵ | |
4 | XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);↵ | 4 | XYPlot subplot1 = new XYPlot(data1, xAxis1, null, renderer1);↵ | |
5 | subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);↵ | 5 | subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);↵ | |
6 | ↵ | 6 | ↵ | |
7 | XYTextAnnotation annotation ↵ | 7 | XYTextAnnotation annotation ↵ | |
8 | = new XYTextAnnotation("Hello!", 50.0, 10000.0);↵ | 8 | = new XYTextAnnotation("Hello!", 50.0, 10000.0);↵ | |
9 | annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));↵ | 9 | annotation.setFont(new Font("SansSerif", Font.PLAIN, 9));↵ | |
10 | annotation.setRotationAngle(Math.PI / 4.0);↵ | 10 | annotation.setRotationAngle(Math.PI / 4.0);↵ | |
11 | subplot1.addAnnotation(annotation);↵ | 11 | subplot1.addAnnotation(annotation);↵ | |
12 | ↵ | 12 | ↵ | |
13 | // create subplot 2...↵ | 13 | // create subplot 2...↵ | |
14 | XYDataset data2 = createDataset2();↵ | 14 | XYDataset data2 = createDataset2();↵ | |
15 | XYItemRenderer renderer2 = new StandardXYItemRenderer();↵ | 15 | XYItemRenderer renderer2 = new StandardXYItemRenderer();↵ | |
16 | NumberAxis rangeAxis2 = new NumberAxis("Range 2");↵ | 16 | NumberAxis xAxis2 = new NumberAxis("X2");↵ | |
17 | rangeAxis2.setAutoRangeIncludesZero(false);↵ | 17 | xAxis2.setAutoRangeIncludesZero(false);↵ | |
18 | XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2);↵ | 18 | XYPlot subplot2 = new XYPlot(data2, xAxis2, null, renderer2);↵ | |
19 | subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT);↵ | 19 | subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT); ↵ | |
20 | // parent plot...↵ | 20 | // parent plot...↵ | |
21 | CombinedDomainXYPlot plot ↵ | 21 | CombinedRangeXYPlot plot ↵ | |
22 | = new CombinedDomainXYPlot(new NumberAxis("Domain↵ | 22 | = new CombinedRangeXYPlot(new NumberAxis(↵ | |
23 | "));↵ | 23 | "Range"));↵ | |
24 | plot.setGap(10.0);↵ | 24 | plot.setGap(10.0);↵ | |
25 | ↵ | 25 | ↵ | |
26 | // add the subplots...↵ | 26 | // add the subplots...↵ | |
27 | plot.add(subplot1, 1);↵ | 27 | plot.add(subplot1, 1);↵ | |
28 | plot.add(subplot2, 1);↵ | 28 | plot.add(subplot2, 1);↵ | |
29 | plot.setOrientation(PlotOrientation.VERTICAL);↵ | 29 | plot.setOrientation(PlotOrientation.VERTICAL);↵ | |
30 | return plot; | 30 |
| |
See real code fragment | See real code fragment |
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 174 |
Number of mapped statements | 21 |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | XYDataset data1 = createDataset1(); | 1 | XYDataset data1 = createDataset1(); | ||||||||||||||||||||||
2 | XYItemRenderer renderer1 = new StandardXYItemRenderer(); | 2 | XYItemRenderer renderer1 = new StandardXYItemRenderer(); | ||||||||||||||||||||||
3 | NumberAxis rangeAxis1 = new NumberAxis("Range 1"); |
| 3 | NumberAxis xAxis1 = new NumberAxis("X1"); | |||||||||||||||||||||
4 | XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1); |
| 4 | XYPlot subplot1 = new XYPlot(data1, xAxis1, null, renderer1); | |||||||||||||||||||||
5 | subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT); | 5 | subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT); | ||||||||||||||||||||||
6 | XYTextAnnotation annotation = new XYTextAnnotation("Hello!", 50.0, 10000.0); | 6 | XYTextAnnotation annotation = new XYTextAnnotation("Hello!", 50.0, 10000.0); | ||||||||||||||||||||||
7 | annotation.setFont(new Font("SansSerif", Font.PLAIN, 9)); | 7 | annotation.setFont(new Font("SansSerif", Font.PLAIN, 9)); | ||||||||||||||||||||||
8 | annotation.setRotationAngle(Math.PI / 4.0); | 8 | annotation.setRotationAngle(Math.PI / 4.0); | ||||||||||||||||||||||
9 | subplot1.addAnnotation(annotation); | 9 | subplot1.addAnnotation(annotation); | ||||||||||||||||||||||
10 | XYDataset data2 = createDataset2(); | 10 | XYDataset data2 = createDataset2(); | ||||||||||||||||||||||
11 | XYItemRenderer renderer2 = new StandardXYItemRenderer(); | 11 | XYItemRenderer renderer2 = new StandardXYItemRenderer(); | ||||||||||||||||||||||
12 | NumberAxis rangeAxis2 = new NumberAxis("Range 2"); |
| 12 | NumberAxis xAxis2 = new NumberAxis("X2"); | |||||||||||||||||||||
13 | rangeAxis2.setAutoRangeIncludesZero(false); |
| 13 | xAxis2.setAutoRangeIncludesZero(false); | |||||||||||||||||||||
14 | XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2); |
| 14 | XYPlot subplot2 = new XYPlot(data2, xAxis2, null, renderer2); | |||||||||||||||||||||
15 | subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT); | 15 | subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT); | ||||||||||||||||||||||
16 | CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new NumberAxis("Domain")); |
| 16 | CombinedRangeXYPlot plot = new CombinedRangeXYPlot(new NumberAxis("Range")); | |||||||||||||||||||||
17 | plot.setGap(10.0); |
| 17 | plot.setGap(10.0); | |||||||||||||||||||||
18 | plot.add(subplot1, 1); |
| 18 | plot.add(subplot1, 1); | |||||||||||||||||||||
19 | plot.add(subplot2, 1); |
| 19 | plot.add(subplot2, 1); | |||||||||||||||||||||
20 | plot.setOrientation(PlotOrientation.VERTICAL); |
| 20 | plot.setOrientation(PlotOrientation.VERTICAL); | |||||||||||||||||||||
21 | return plot; |
| 21 | return plot; |
Row | Violation |
---|---|
1 | Expression xAxis1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression rangeAxis1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression xAxis2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression rangeAxis2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression new CombinedDomainXYPlot(new NumberAxis("Domain")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression new CombinedRangeXYPlot(new NumberAxis("Range")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public void setGap(double) |
8 | Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public void add(org.jfree.chart.plot.XYPlot, int) |
9 | Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.XYPlot does not declare member(s) public void add(org.jfree.chart.plot.XYPlot, int) |