File path: /jfreechart-1.0.10/src/org/jfree/data/time/Day.java | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Hour.java | |||
Method name: long getLastMillisecond(Calendar)
|
Method name: long getFirstMillisecond(Calendar)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | int year = this.serialDate.getYYYY();↵ | 1 | int year = this.day.getYear();↵ | |
2 | int month = this.serialDate.getMonth();↵ | 2 | int month = this.day.getMonth() - 1;↵ | |
3 | int day = this.serialDate.getDayOfMonth();↵ | 3 | int dom = this.day.getDayOfMonth();↵ | |
4 | calendar.clear();↵ | |||
5 | calendar.set(year, month - 1, day, 23, 59, 59);↵ | 4 | calendar.set(year, month, dom, this.hour, 0, 0);↵ | |
6 | calendar.set(Calendar.MILLISECOND, 999);↵ | 5 | calendar.set(Calendar.MILLISECOND, 0);↵ | |
7 | //return calendar.getTimeInMillis(); // this won't work for JDK 1.3↵ | 6 | //return calendar.getTimeInMillis(); // this won't work for JDK 1.3↵ | |
8 | return calendar.getTime().getTime(); | 7 |
| |
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 42 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | int year = this.day.getYear(); | |||||||||||||||||||||||
1 | int year = this.serialDate.getYYYY(); | | |||||||||||||||||||||||
2 | int month = this.serialDate.getMonth(); |
| 2 | int month = this.day.getMonth() - 1; | |||||||||||||||||||||
3 | int day = this.serialDate.getDayOfMonth(); |
| 3 | int dom = this.day.getDayOfMonth(); | |||||||||||||||||||||
4 | calendar.clear(); |
| 4 | calendar.set(year, month, dom, this.hour, 0, 0); | |||||||||||||||||||||
5 | calendar.set(year, month - 1, day, 23, 59, 59); |
| 5 | calendar.set(Calendar.MILLISECOND, 0); | |||||||||||||||||||||
|
| 6 | return calendar.getTime().getTime(); | ||||||||||||||||||||||
6 | calendar.set(Calendar.MILLISECOND, 999); |
| | ||||||||||||||||||||||
7 | return calendar.getTime().getTime(); |
| |
Row | Violation |
---|---|
1 | Type org.jfree.date.SerialDate of variable this.serialDate does not match with type org.jfree.data.time.Day of variable this.day |
2 | Expression calendar.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression calendar.set(year,month,dom,this.hour,0,0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression calendar.clear() is a void method call, and thus it cannot be parameterized |
5 | Expression calendar.set(year,month,dom,this.hour,0,0) is a void method call, and thus it cannot be parameterized |
6 | Expression calendar.clear() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression calendar.set(year,month,dom,this.hour,0,0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression calendar.clear() is a void method call, and thus it cannot be parameterized |
9 | Expression calendar.set(year,month,dom,this.hour,0,0) is a void method call, and thus it cannot be parameterized |
10 | Expression calendar.set(year,month - 1,day,23,59,59) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression calendar.set(Calendar.MILLISECOND,0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression calendar.set(year,month - 1,day,23,59,59) is a void method call, and thus it cannot be parameterized |
13 | Expression calendar.set(Calendar.MILLISECOND,0) is a void method call, and thus it cannot be parameterized |
14 | Unmatched statement return calendar.getTime().getTime(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
15 | Unmatched return calendar.getTime().getTime(); |
16 | Unmatched statement calendar.set(Calendar.MILLISECOND,999); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
17 | Unmatched statement return calendar.getTime().getTime(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
18 | Unmatched return calendar.getTime().getTime(); |