File path: /jfreechart-1.0.10/src/org/jfree/data/time/Hour.java | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Hour.java | |||
Method name: long getFirstMillisecond(Calendar)
|
Method name: long getLastMillisecond(Calendar)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | int year = this.day.getYear();↵ | 1 | int year = this.day.getYear();↵ | |
2 | int month = this.day.getMonth() - 1;↵ | 2 | int month = this.day.getMonth() - 1;↵ | |
3 | int dom = this.day.getDayOfMonth();↵ | 3 | int dom = this.day.getDayOfMonth();↵ | |
4 | calendar.set(year, month, dom, this.hour, 0, 0);↵ | 4 | calendar.set(year, month, dom, this.hour, 59, 59);↵ | |
5 | calendar.set(Calendar.MILLISECOND, 0);↵ | 5 | calendar.set(Calendar.MILLISECOND, 999);↵ | |
6 | //return calendar.getTimeInMillis(); // this won't work for JDK 1.3↵ | 6 | //return calendar.getTimeInMillis(); // this won't work for JDK 1.3↵ | |
7 | return calendar.getTime().getTime(); | 7 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 36 |
Number of mapped statements | 6 |
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 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int year = this.day.getYear(); | 1 | int year = this.day.getYear(); | ||||||||||||||
2 | int month = this.day.getMonth() - 1; | 2 | int month = this.day.getMonth() - 1; | ||||||||||||||
3 | int dom = this.day.getDayOfMonth(); | 3 | int dom = this.day.getDayOfMonth(); | ||||||||||||||
4 | calendar.set(year, month, dom, this.hour, 0, 0); |
| 4 | calendar.set(year, month, dom, this.hour, 59, 59); | |||||||||||||
5 | calendar.set(Calendar.MILLISECOND, 0); |
| 5 | calendar.set(Calendar.MILLISECOND, 999); | |||||||||||||
6 | return calendar.getTime().getTime(); | 6 | return calendar.getTime().getTime(); |
Row | Violation |
---|