Point2D selectOrigin = translateScreenToJava2D(new Point(x, y));
int subplotIndex = plotInfo.getSubplotIndex(selectOrigin);
if (subplotIndex == -1) {
return null;
}
result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea());
Point2D selectOrigin = translateScreenToJava2D(new Point(x, y));
int subplotIndex = plotInfo.getSubplotIndex(selectOrigin);
if (subplotIndex == -1) {
return null;
}
result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea());
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java
|
|
File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/ChartComposite.java
|
Method name: Rectangle2D getScreenDataArea(int, int)
|
|
Method name: Rectangle getScreenDataArea(int, int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | Point2D selectOrigin = translateScreenToJava2D(new Point(x, y));
↵ | | 1 | Point2D selectOrigin = translateScreenToJava2D(new Point(x, y));↵
|
2 | int subplotIndex = plotInfo.getSubplotIndex(selectOrigin);
↵ | | 2 | int subplotIndex = plotInfo.getSubplotIndex(selectOrigin);↵
|
3 | if (subplotIndex == -1) {
↵ | | 3 | if (subplotIndex == -1) {↵
|
4 | return null;
↵ | | 4 | return null;↵
|
5 | }
↵ | | 5 | }↵
|
6 | result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea()); | | 6 | result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea());
|
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 |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 3.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | Point2D selectOrigin = translateScreenToJava2D(new Point(x, y)); | | 5 | Point2D selectOrigin = translateScreenToJava2D(new Point(x, y)); |
6 | int subplotIndex = plotInfo.getSubplotIndex(selectOrigin); | | 6 | int subplotIndex = plotInfo.getSubplotIndex(selectOrigin); |
7 | if (subplotIndex == -1) | | 7 | if (subplotIndex == -1) |
8 | | | 8 | |
| | | 9 | result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea()); |
9 | result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea()); | | | |
Precondition Violations (4)
Row |
Violation |
1 | Unmatched statement result=scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement result=scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Not all possible execution flows end in a return statement |
4 | The refactoring of the clones is infeasible, because classes org.jfree.chart.ChartPanel and org.jfree.experimental.chart.swt.ChartComposite do not have a common superclass |