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: 5 | Number of AST nodes: 6 | |||
1 | if (this.adjustForDaylightSaving) {↵ | 1 | if (this.adjustForDaylightSaving) {↵ | |
2 | this.workingCalendarNoDST.setTime(new Date(date));↵ | 2 | this.workingCalendar.setTime(date);↵ | |
3 | this.workingCalendar.set(↵ | 3 | this.workingCalendarNoDST.set(↵ | |
4 | this.workingCalendarNoDST.get(Calendar.YEAR),↵ | 4 | this.workingCalendar.get(Calendar.YEAR),↵ | |
5 | this.workingCalendarNoDST.get(Calendar.MONTH),↵ | 5 | this.workingCalendar.get(Calendar.MONTH),↵ | |
6 | this.workingCalendarNoDST.get(Calendar.DATE),↵ | 6 | this.workingCalendar.get(Calendar.DATE),↵ | |
7 | this.workingCalendarNoDST.get(Calendar.HOUR_OF_DAY),↵ | 7 | this.workingCalendar.get(Calendar.HOUR_OF_DAY),↵ | |
8 | this.workingCalendarNoDST.get(Calendar.MINUTE),↵ | 8 | this.workingCalendar.get(Calendar.MINUTE),↵ | |
9 | this.workingCalendarNoDST.get(Calendar.SECOND)↵ | 9 | this.workingCalendar.get(Calendar.SECOND)↵ | |
10 | );↵ | 10 | );↵ | |
11 | this.workingCalendar.set(Calendar.MILLISECOND,↵ | 11 | this.workingCalendarNoDST.set(Calendar.MILLISECOND,↵ | |
12 | this.workingCalendarNoDST.get(Calendar.MILLISECOND));↵ | 12 | this.workingCalendar.get(Calendar.MILLISECOND));↵ | |
13 | // result = this.workingCalendar.getTimeInMillis();↵ | 13 | Date revisedDate = this.workingCalendarNoDST.getTime();↵ | |
14 | // preceding code won't work with JDK 1.3↵ | 14 | ↵ | |
15 | result = this.workingCalendar.getTime().getTime();↵ | 15 | result = revisedDate.getTime();↵ | |
16 | } | 16 |
| |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 30 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 19.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (this.adjustForDaylightSaving) | 2 | if (this.adjustForDaylightSaving) | |||||||||||||||||||||||||||||||||||||||||
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 | Expression this.workingCalendarNoDST cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression this.workingCalendar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression this.workingCalendarNoDST cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression this.workingCalendar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression this.workingCalendarNoDST cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression this.workingCalendar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression this.workingCalendarNoDST cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression this.workingCalendar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression this.workingCalendarNoDST cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression this.workingCalendar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression this.workingCalendarNoDST cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression this.workingCalendar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression this.workingCalendarNoDST cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression this.workingCalendar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression this.workingCalendar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression this.workingCalendarNoDST cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Unmatched statement Date revisedDate=this.workingCalendarNoDST.getTime(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
18 | Unmatched statement result=this.workingCalendar.getTime().getTime(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
19 | Unmatched statement result=revisedDate.getTime(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |