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: 8 | Number of AST nodes: 8 | |||
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);↵ | |
16 | String dayString = null↵ | 16 | String dayString = new Integer(day)↵ | |
17 | ; | 17 | .toString(); | |
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.9 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 36 |
Number of mapped statements | 7 |
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) | 7.5 |
Clone type | Type 2 |
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)); | ||||
else | else | ||||||
13 | g2.setColor(darkDarkGrayColor); | 13 | g2.setColor(darkDarkGrayColor); | ||||
|
| 14 | String dayString = new Integer(day).toString(); | ||||
14 | String dayString = null; | |
Row | Violation |
---|---|
1 | Unmatched statement String dayString=new Integer(day).toString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Clone fragment #1 returns variables day, range, dayString, r , while Clone fragment #2 returns variables dayString, r |
3 | The refactoring of the clones is infeasible, because classes and do not have a common superclass |