if ((rows * columns) > 0) {
state.setBarWidth(Math.min(used / (dataset.getColumnCount()
* dataset.getRowCount()), maxWidth));
}
else {
state.setBarWidth(Math.min(used, maxWidth));
}
if ((rows * columns) > 0) {
state.setBarWidth(Math.min(used / (dataset.getColumnCount()),
maxWidth));
}
else {
state.setBarWidth(Math.min(used, maxWidth));
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LayeredBarRenderer.java
|
Method name: CategoryItemRendererState initialise(Graphics2D, Rectangle2D, CategoryPlot, int, PlotRenderingInfo)
|
|
Method name: void calculateBarWidth(CategoryPlot, Rectangle2D, int, CategoryItemRendererState)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if ((rows * columns) > 0) {↵ | | 1 | if ((rows * columns) > 0) {↵
|
2 | state.setBarWidth(Math.min(used / (dataset.getColumnCount()↵ | | 2 | state.setBarWidth(Math.min(used / (dataset.getColumnCount()),↵
|
3 | * dataset.getRowCount()), maxWidth));↵ | | 3 | maxWidth));↵
|
4 | }↵ | | 4 | }↵
|
5 | else {↵ | | 5 | else {↵
|
6 | state.setBarWidth(Math.min(used, maxWidth));↵ | | 6 | state.setBarWidth(Math.min(used, maxWidth));↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
21 | if ((rows * columns) > 0) | | 17 | if ((rows * columns) > 0) |
22 | state.setBarWidth(Math.min(used / (dataset.getColumnCount() * dataset.getRowCount()), maxWidth)); | | 18 | state.setBarWidth(Math.min(used / (dataset.getColumnCount()), maxWidth)); |
| | | | |
23 | state.setBarWidth(Math.min(used, maxWidth)); | | 19 | state.setBarWidth(Math.min(used, maxWidth)); |
Precondition Violations (0)
Row |
Violation |