File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedDomainCategoryPlotTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CombinedRangeXYPlotTests.java | |||
Method name: void testNotification()
|
Method name: void testNotification()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | CombinedDomainCategoryPlot plot = createPlot();↵ | 1 | CombinedRangeXYPlot plot = createPlot();↵ | |
2 | JFreeChart chart = new JFreeChart(plot);↵ | 2 | JFreeChart chart = new JFreeChart(plot);↵ | |
3 | chart.addChangeListener(this);↵ | 3 | chart.addChangeListener(this);↵ | |
4 | CategoryPlot subplot1 = (CategoryPlot) plot.getSubplots().get(0);↵ | 4 | XYPlot subplot1 = (XYPlot) plot.getSubplots().get(0);↵ | |
5 | NumberAxis yAxis = (NumberAxis) subplot1.getRangeAxis();↵ | 5 | NumberAxis xAxis = (NumberAxis) subplot1.getDomainAxis();↵ | |
6 | yAxis.setAutoRangeIncludesZero(!yAxis.getAutoRangeIncludesZero());↵ | 6 | xAxis.setAutoRangeIncludesZero(!xAxis.getAutoRangeIncludesZero());↵ | |
7 | assertEquals(1, this.events.size());↵ | 7 | assertEquals(1, this.events.size());↵ | |
8 | ↵ | 8 | ↵ | |
9 | // a redraw should NOT trigger another change event↵ | 9 | // a redraw should NOT trigger another change event↵ | |
10 | BufferedImage image = new BufferedImage(200, 100, ↵ | 10 | BufferedImage image = new BufferedImage(200, 100, ↵ | |
11 | BufferedImage.TYPE_INT_RGB);↵ | 11 | BufferedImage.TYPE_INT_RGB);↵ | |
12 | Graphics2D g2 = image.createGraphics();↵ | 12 | Graphics2D g2 = image.createGraphics();↵ | |
13 | this.events.clear();↵ | 13 | this.events.clear();↵ | |
14 | chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0));↵ | 14 | chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0));↵ | |
15 | assertTrue(this.events.isEmpty()); | 15 |
| |
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 | 61 |
Number of mapped statements | 12 |
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 | CombinedDomainCategoryPlot plot = createPlot(); |
| 1 | CombinedRangeXYPlot plot = createPlot(); | ||||||||||||||||||||||
2 | JFreeChart chart = new JFreeChart(plot); |
| 2 | JFreeChart chart = new JFreeChart(plot); | ||||||||||||||||||||||
3 | chart.addChangeListener(this); | 3 | chart.addChangeListener(this); | |||||||||||||||||||||||
4 | CategoryPlot subplot1 = (CategoryPlot)plot.getSubplots().get(0); |
| 4 | XYPlot subplot1 = (XYPlot)plot.getSubplots().get(0); | ||||||||||||||||||||||
5 | NumberAxis yAxis = (NumberAxis)subplot1.getRangeAxis(); |
| 5 | NumberAxis xAxis = (NumberAxis)subplot1.getDomainAxis(); | ||||||||||||||||||||||
6 | yAxis.setAutoRangeIncludesZero(!yAxis.getAutoRangeIncludesZero()); |
| 6 | xAxis.setAutoRangeIncludesZero(!xAxis.getAutoRangeIncludesZero()); | ||||||||||||||||||||||
7 | assertEquals(1, this.events.size()); | 7 | assertEquals(1, this.events.size()); | |||||||||||||||||||||||
8 | BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB); | 8 | BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB); | |||||||||||||||||||||||
9 | Graphics2D g2 = image.createGraphics(); | 9 | Graphics2D g2 = image.createGraphics(); | |||||||||||||||||||||||
10 | this.events.clear(); | 10 | this.events.clear(); | |||||||||||||||||||||||
11 | chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0)); | 11 | chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0)); | |||||||||||||||||||||||
12 | assertTrue(this.events.isEmpty()); | 12 | assertTrue(this.events.isEmpty()); |
Row | Violation |
---|---|
1 | Expression (CategoryPlot)plot.getSubplots().get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression (XYPlot)plot.getSubplots().get(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public List#RAW getSubplots() |
4 | Expression subplot1.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression subplot1.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression subplot1 cannot be unified with expression subplot1 , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.axis.ValueAxis getRangeAxis() , public org.jfree.chart.axis.ValueAxis getDomainAxis() |