if (this.orientation == PlotOrientation.HORIZONTAL) {
r[0] = new Rectangle2D.Double(Math.min(yymax, yy),
Math.min(xxmin, xx), Math.abs(yy - yymax),
Math.abs(xx - xxmin)
);
}
else { // PlotOrientation.VERTICAL
r[0] = new Rectangle2D.Double(Math.min(xxmin, xx),
Math.min(yymax, yy), Math.abs(xx - xxmin),
Math.abs(yy - yymax));
}
somethingToDraw = true;
if (this.orientation == PlotOrientation.HORIZONTAL) {
r[1] = new Rectangle2D.Double(Math.min(yymax, yy),
Math.min(xxmax, xx), Math.abs(yy - yymax),
Math.abs(xx - xxmax));
}
else { // PlotOrientation.VERTICAL
r[1] = new Rectangle2D.Double(Math.min(xx, xxmax),
Math.min(yymax, yy), Math.abs(xx - xxmax),
Math.abs(yy - yymax));
}
somethingToDraw = true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
|
Method name: void drawQuadrants(Graphics2D, Rectangle2D)
|
|
Method name: void drawQuadrants(Graphics2D, Rectangle2D)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (this.orientation == PlotOrientation.HORIZONTAL) {↵ | | 1 | if (this.orientation == PlotOrientation.HORIZONTAL) {↵
|
2 | r[0] = new Rectangle2D.Double(Math.min(yymax, yy),↵ | | 2 | r[1] = new Rectangle2D.Double(Math.min(yymax, yy),↵
|
3 | Math.min(xxmin, xx), Math.abs(yy - yymax),↵ | | 3 | Math.min(xxmax, xx), Math.abs(yy - yymax),↵
|
4 | Math.abs(xx - xxmin)↵ | | 4 | Math.abs(xx - xxm↵
|
5 | );↵ | | 5 | ax));↵
|
6 | }↵ | | 6 | }↵
|
7 | else { // PlotOrientation.VERTICAL↵ | | 7 | else { // PlotOrientation.VERTICAL↵
|
8 | r[0] = new Rectangle2D.Double(Math.min(xxmin, xx),↵ | | 8 | r[1] = new Rectangle2D.Double(Math.min(xx, xxmax),↵
|
9 | Math.min(yymax, yy), Math.abs(xx - xxmin),↵ | | 9 | Math.min(yymax, yy), Math.abs(xx - xxmax),↵
|
10 | Math.abs(yy - yymax));↵ | | 10 | Math.abs(yy - yymax));↵
|
11 | }↵ | | 11 | }↵
|
12 | somethingToDraw = true; | | 12 | somethingToDraw = true;
|
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 3.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
19 | if (this.orientation == PlotOrientation.HORIZONTAL) | | 25 | if (this.orientation == PlotOrientation.HORIZONTAL) |
20 | r[0] = new Rectangle2D.Double(Math.min(yymax, yy), Math.min(xxmin, xx), Math.abs(yy - yymax), Math.abs(xx - xxmin)); | | 26 | r[1] = new Rectangle2D.Double(Math.min(yymax, yy), Math.min(xxmax, xx), Math.abs(yy - yymax), Math.abs(xx - xxmax)); |
| | | | |
21 | r[0] = new Rectangle2D.Double(Math.min(xxmin, xx), Math.min(yymax, yy), Math.abs(xx - xxmin), Math.abs(yy - yymax)); | | 27 | r[1] = new Rectangle2D.Double(Math.min(xx, xxmax), Math.min(yymax, yy), Math.abs(xx - xxmax), Math.abs(yy - yymax)); |
22 | somethingToDraw = true; | | 28 | somethingToDraw = true; |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables somethingToDraw, r , while Clone fragment #2 returns variables somethingToDraw, r |