dateAreaBean = DateAreaBeanFactory.initDateArea();
// enable selection
dateAreaBean.setSelectionType(DateArea.SELECTION_TYPE_NORMAL);
Calendar today = Calendar.getInstance();
long startMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 0, 0).getTimeInMillis();
long endMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 12, 31).getTimeInMillis();
ImmutableDateRange dr = new ImmutableDateRange(startMillis, endMillis,
false, null, null);
dateAreaBean.getDateArea().setVisibleDateRange(dr);
dateAreaBean = DateAreaBeanFactory.initDateArea();
// enable selection
dateAreaBean.setSelectionType(DateArea.SELECTION_TYPE_NORMAL);
Calendar today = Calendar.getInstance();
long startMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 0, 0).getTimeInMillis();
long endMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 12, 31).getTimeInMillis();
ImmutableDateRange dr = new ImmutableDateRange(startMillis, endMillis,
false, null, null);
dateAreaBean.getDateArea().setVisibleDateRange(dr);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/navigation/NavigationController.java
|
|
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/comp/DatePicker.java
|
Method name: void NavigationController()
|
|
Method name: void DatePicker()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | dateAreaBean = DateAreaBeanFactory.initDateArea();↵ | | 1 | dateAreaBean = DateAreaBeanFactory.initDateArea();↵
|
|
2 | // enable selection↵ | | 2 | // enable selection↵
|
3 | dateAreaBean.setSelectionType(DateArea.SELECTION_TYPE_NORMAL);↵ | | 3 | dateAreaBean.setSelectionType(DateArea.SELECTION_TYPE_NORMAL);↵
|
|
4 | Calendar today = Calendar.getInstance();↵ | | 4 | Calendar today = Calendar.getInstance();↵
|
5 | long startMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 0, 0).getTimeInMillis();↵ | | 5 | long startMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 0, 0).getTimeInMillis();↵
|
6 | long endMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 12, 31).getTimeInMillis();↵ | | 6 | long endMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 12, 31).getTimeInMillis();↵
|
7 | ImmutableDateRange dr = new ImmutableDateRange(startMillis, endMillis,↵ | | 7 | ImmutableDateRange dr = new ImmutableDateRange(startMillis, endMillis,↵
|
8 | false, null, null);↵ | | 8 | false, null, null);↵
|
9 | ↵ | | 9 | ↵
|
10 | dateAreaBean.getDateArea().setVisibleDateRange(dr); | | 10 | dateAreaBean.getDateArea().setVisibleDateRange(dr);
|
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 22 |
-
{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) | 0.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | dateAreaBean = DateAreaBeanFactory.initDateArea(); | | 2 | dateAreaBean = DateAreaBeanFactory.initDateArea(); |
2 | dateAreaBean.setSelectionType(DateArea.SELECTION_TYPE_NORMAL); | | 3 | dateAreaBean.setSelectionType(DateArea.SELECTION_TYPE_NORMAL); |
3 | Calendar today = Calendar.getInstance(); | | 4 | Calendar today = Calendar.getInstance(); |
4 | long startMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 0, 0).getTimeInMillis(); | | 5 | long startMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 0, 0).getTimeInMillis(); |
5 | long endMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 12, 31).getTimeInMillis(); | | 6 | long endMillis = new GregorianCalendar(today.get(java.util.Calendar.YEAR), 12, 31).getTimeInMillis(); |
6 | ImmutableDateRange dr = new ImmutableDateRange(startMillis, endMillis, false, null, null); | | 7 | ImmutableDateRange dr = new ImmutableDateRange(startMillis, endMillis, false, null, null); |
7 | dateAreaBean.getDateArea().setVisibleDateRange(dr); | | 8 | dateAreaBean.getDateArea().setVisibleDateRange(dr); |
Precondition Violations (1)
Row |
Violation |
1 | The refactoring of the clones is infeasible, because classes org.columba.calendar.ui.navigation.NavigationController and org.columba.calendar.ui.comp.DatePicker do not have a common superclass |