File path: /jfreechart-1.0.10/src/org/jfree/data/time/Minute.java | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Minute.java | |||
Method name: RegularTimePeriod previous()
|
Method name: RegularTimePeriod next()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | Minute result;↵ | 1 | Minute result;↵ | |
2 | if (this.minute != FIRST_MINUTE_IN_HOUR) {↵ | 2 | if (this.minute != LAST_MINUTE_IN_HOUR) {↵ | |
3 | result = new Minute(this.minute - 1, getHour());↵ | 3 | result = new Minute(this.minute + 1, getHour());↵ | |
4 | }↵ | 4 | }↵ | |
5 | else {↵ | 5 | else { // we are at the last minute in the hour...↵ | |
6 | Hour h = (Hour) getHour().previous();↵ | 6 | Hour nextHour = (Hour) getHour().next();↵ | |
7 | if (h != null) {↵ | 7 | if (nextHour != null) {↵ | |
8 | result = new Minute(LAST_MINUTE_IN_HOUR, h);↵ | 8 | result = new Minute(FIRST_MINUTE_IN_HOUR, nextHour);↵ | |
9 | }↵ | 9 | }↵ | |
10 | else {↵ | 10 | else {↵ | |
11 | result = null;↵ | 11 | result = null;↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | return result; | 14 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 22 |
Number of mapped statements | 8 |
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) | 2.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Minute result; | 1 | Minute result; | ||||||||||||||
2 | if (this.minute != FIRST_MINUTE_IN_HOUR) |
| 2 | if (this.minute != LAST_MINUTE_IN_HOUR) | |||||||||||||
3 | result = new Minute(this.minute - 1, getHour()); |
| 3 | result = new Minute(this.minute + 1, getHour()); | |||||||||||||
else | else | ||||||||||||||||
4 | Hour h = (Hour)getHour().previous(); |
| 4 | Hour nextHour = (Hour)getHour().next(); | |||||||||||||
5 | if (h != null) |
| 5 | if (nextHour != null) | |||||||||||||
6 | result = new Minute(LAST_MINUTE_IN_HOUR, h); |
| 6 | result = new Minute(FIRST_MINUTE_IN_HOUR, nextHour); | |||||||||||||
else | else | ||||||||||||||||
7 | result = null; | 7 | result = null; | ||||||||||||||
8 | return result; | 8 | return result; |
Row | Violation |
---|---|
1 | Expression this.minute - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression this.minute + 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |