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); String dayString = null;
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); String dayString = new Integer(day) .toString();
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: 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();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.9
Clones locationClones are in different classes having the same super class
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)7.5
    Clone typeType 2
    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));
    else
    else
    13
    g2.setColor(darkDarkGrayColor);
    13
    g2.setColor(darkDarkGrayColor);
                                                                                                      
    14
    String dayString = new Integer(day).toString();
    Preondition Violations
    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
    14
    String dayString = new Integer(day).toString();
    14
    String dayString = null;
                                                        
    Precondition Violations (3)
    Row Violation
    1Unmatched 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
    2Clone fragment #1 returns variables day, range, dayString, r , while Clone fragment #2 returns variables dayString, r
    3The refactoring of the clones is infeasible, because classes and do not have a common superclass