File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/SegmentedTimeline.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/SegmentedTimeline.java | |||
Method name: long getTimeFromLong(long)
|
Method name: long getTime(Date)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 5 | |||
1 | this.workingCalendarNoDST.setTime(new Date(date));↵ | 1 | this.workingCalendar.setTime(date);↵ | |
2 | this.workingCalendar.set(↵ | 2 | this.workingCalendarNoDST.set(↵ | |
3 | this.workingCalendarNoDST.get(Calendar.YEAR),↵ | 3 | this.workingCalendar.get(Calendar.YEAR),↵ | |
4 | this.workingCalendarNoDST.get(Calendar.MONTH),↵ | 4 | this.workingCalendar.get(Calendar.MONTH),↵ | |
5 | this.workingCalendarNoDST.get(Calendar.DATE),↵ | 5 | this.workingCalendar.get(Calendar.DATE),↵ | |
6 | this.workingCalendarNoDST.get(Calendar.HOUR_OF_DAY),↵ | 6 | this.workingCalendar.get(Calendar.HOUR_OF_DAY),↵ | |
7 | this.workingCalendarNoDST.get(Calendar.MINUTE),↵ | 7 | this.workingCalendar.get(Calendar.MINUTE),↵ | |
8 | this.workingCalendarNoDST.get(Calendar.SECOND)↵ | 8 | this.workingCalendar.get(Calendar.SECOND)↵ | |
9 | );↵ | 9 | );↵ | |
10 | this.workingCalendar.set(Calendar.MILLISECOND,↵ | 10 | this.workingCalendarNoDST.set(Calendar.MILLISECOND,↵ | |
11 | this.workingCalendarNoDST.get(Calendar.MILLISECOND));↵ | 11 | this.workingCalendar.get(Calendar.MILLISECOND));↵ | |
12 | // result = this.workingCalendar.getTimeInMillis();↵ | 12 | Date revisedDate = this.workingCalendarNoDST.getTime();↵ | |
13 | // preceding code won't work with JDK 1.3↵ | 13 | ↵ | |
14 | result = this.workingCalendar.getTime().getTime(); | 14 | result = revisedDate.getTime(); | |
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 declared in the same class |
Number of node comparisons | 20 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | this.workingCalendarNoDST.setTime(new Date(date)); |
| 3 | this.workingCalendar.setTime(date); | ||||||||||||||||||||||||||||
4 | this.workingCalendar.set(this.workingCalendarNoDST.get(Calendar.YEAR), this.workingCalendarNoDST.get(Calendar.MONTH), this.workingCalendarNoDST.get(Calendar.DATE), this.workingCalendarNoDST.get(Calendar.HOUR_OF_DAY), this.workingCalendarNoDST.get(Calendar.MINUTE), this.workingCalendarNoDST.get(Calendar.SECOND)); |
| 4 | this.workingCalendarNoDST.set(this.workingCalendar.get(Calendar.YEAR), this.workingCalendar.get(Calendar.MONTH), this.workingCalendar.get(Calendar.DATE), this.workingCalendar.get(Calendar.HOUR_OF_DAY), this.workingCalendar.get(Calendar.MINUTE), this.workingCalendar.get(Calendar.SECOND)); | ||||||||||||||||||||||||||||
5 | this.workingCalendar.set(Calendar.MILLISECOND, this.workingCalendarNoDST.get(Calendar.MILLISECOND)); |
| 5 | this.workingCalendarNoDST.set(Calendar.MILLISECOND, this.workingCalendar.get(Calendar.MILLISECOND)); | ||||||||||||||||||||||||||||
|
| 6 | Date revisedDate = this.workingCalendarNoDST.getTime(); | |||||||||||||||||||||||||||||
6 | result = this.workingCalendar.getTime().getTime(); |
| 7 | result = revisedDate.getTime(); |
Row | Violation |
---|---|
1 | Unmatched statement Date revisedDate=this.workingCalendarNoDST.getTime(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression this.workingCalendar.getTime() cannot be parameterized, because it has dependencies to/from statements that will be extracted |