Rectangle r = dateGrid.getBoundsOfCell(
i, j, Grid.SIZE_MODE_INSIDE,
true);
DateRangeI range = dateGrid
.getDateRangeForCell(i, j);
int day = range.getStart().get(
Calendar.DAY_OF_MONTH);
int weekday = range.getStart().get(
Calendar.DAY_OF_WEEK);
if (weekday == Calendar.SUNDAY)
g2
.setColor(new Color(255,
102, 102));
else
g2.setColor(darkDarkGrayColor);
Rectangle r = dateGrid.getBoundsOfCell(
i, j, Grid.SIZE_MODE_INSIDE,
true);
DateRangeI range = dateGrid
.getDateRangeForCell(i, j);
int day = range.getStart().get(
Calendar.DAY_OF_MONTH);
int weekday = range.getStart().get(
Calendar.DAY_OF_WEEK);
if (weekday == Calendar.SUNDAY)
g2
.setColor(new Color(255,
102, 102));
else
g2.setColor(darkDarkGrayColor);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/calendar/DateAreaBeanFactory.java
|
|
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/navigation/DateAreaBeanFactory.java
|
Method name: void doPaint(Graphics2D, Rectangle)
|
|
Method name: void doPaint(Graphics2D, Rectangle)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | Rectangle r = dateGrid.getBoundsOfCell(↵ | | 1 | Rectangle r = dateGrid.getBoundsOfCell(↵
|
2 | i, j, Grid.SIZE_MODE_INSIDE,↵ | | 2 | i, j, Grid.SIZE_MODE_INSIDE,↵
|
3 | true);↵ | | 3 | true);↵
|
4 | DateRangeI range = dateGrid↵ | | 4 | DateRangeI range = dateGrid↵
|
5 | .getDateRangeForCell(i, j);↵ | | 5 | .getDateRangeForCell(i, j);↵
|
6 | int day = range.getStart().get(↵ | | 6 | int day = range.getStart().get(↵
|
7 | Calendar.DAY_OF_MONTH);↵ | | 7 | Calendar.DAY_OF_MONTH);↵
|
8 | int weekday = range.getStart().get(↵ | | 8 | int weekday = range.getStart().get(↵
|
9 | Calendar.DAY_OF_WEEK);↵ | | 9 | Calendar.DAY_OF_WEEK);↵
|
10 | if (weekday == Calendar.SUNDAY)↵ | | 10 | if (weekday == Calendar.SUNDAY)↵
|
11 | g2↵ | | 11 | g2↵
|
12 | .setColor(new Color(255,↵ | | 12 | .setColor(new Color(255,↵
|
13 | 102, 102));↵ | | 13 | 102, 102));↵
|
14 | else↵ | | 14 | else↵
|
15 | g2.setColor(darkDarkGrayColor); | | 15 | g2.setColor(darkDarkGrayColor);
|
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.8 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 27 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 6.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | Rectangle r = dateGrid.getBoundsOfCell(i, j, Grid.SIZE_MODE_INSIDE, true); | | 7 | Rectangle r = dateGrid.getBoundsOfCell(i, j, Grid.SIZE_MODE_INSIDE, true); |
8 | DateRangeI range = dateGrid.getDateRangeForCell(i, j); | | 8 | DateRangeI range = dateGrid.getDateRangeForCell(i, j); |
9 | int day = range.getStart().get(Calendar.DAY_OF_MONTH); | | 9 | int day = range.getStart().get(Calendar.DAY_OF_MONTH); |
10 | int weekday = range.getStart().get(Calendar.DAY_OF_WEEK); | | 10 | int weekday = range.getStart().get(Calendar.DAY_OF_WEEK); |
11 | if (weekday == Calendar.SUNDAY) | | 11 | if (weekday == Calendar.SUNDAY) |
12 | g2.setColor(new Color(255, 102, 102)); | | 12 | g2.setColor(new Color(255, 102, 102)); |
| | | | |
13 | g2.setColor(darkDarkGrayColor); | | 13 | g2.setColor(darkDarkGrayColor); |
Precondition Violations (2)
Row |
Violation |
1 | Clone fragment #1 returns variables day, range, r , while Clone fragment #2 returns variables day, r |
2 | The refactoring of the clones is infeasible, because classes and do not have a common superclass |