File path: /jfreechart-1.0.10/src/org/jfree/data/time/Hour.java | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Second.java | |||
Method name: RegularTimePeriod previous()
|
Method name: RegularTimePeriod next()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 7 | |||
1 | Hour result;↵ | 1 | Second result = null;↵ | |
2 | if (this.hour != FIRST_HOUR_IN_DAY) {↵ | 2 | if (this.second != LAST_SECOND_IN_MINUTE) {↵ | |
3 | result = new Hour(this.hour - 1, this.day);↵ | 3 | result = new ↵ | |
4 | }↵ | |||
5 | else { // we are at the first hour in the day...↵ | |||
6 | Day prevDay = (Day) this.day.previous↵ | 4 | Second(this.second + 1, getMinute());↵ | |
5 | }↵ | |||
6 | else {↵ | |||
7 | ();↵ | 7 | Minute next = (Minute) getMinute().next();↵ | |
8 | if (prevDay != null) {↵ | 8 | if (next != null) {↵ | |
9 | result = new Hour(LAST_HOUR_IN_DAY, prevDay);↵ | 9 | result = new ↵ | |
10 | }↵ | |||
11 | else {↵ | |||
12 | result = null;↵ | 10 | Second(FIRST_SECOND_IN_MINUTE, next);↵ | |
13 | }↵ | 11 | }↵ | |
14 | }↵ | 12 | }↵ | |
15 | return result; | 13 |
| |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 14 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 10.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Second result = null; | |||||||||||||||||||||||||||||||||
1 | Hour result; | | |||||||||||||||||||||||||||||||||
2 | if (this.hour != FIRST_HOUR_IN_DAY) |
| 2 | if (this.second != LAST_SECOND_IN_MINUTE) | |||||||||||||||||||||||||||||||
3 | result = new Hour(this.hour - 1, this.day); |
| 3 | result = new Second(this.second + 1, getMinute()); | |||||||||||||||||||||||||||||||
else | else | ||||||||||||||||||||||||||||||||||
4 | Day prevDay = (Day)this.day.previous(); |
| 4 | Minute next = (Minute)getMinute().next(); | |||||||||||||||||||||||||||||||
|
| 5 | if (next != null) | ||||||||||||||||||||||||||||||||
|
| 6 | result = new Second(FIRST_SECOND_IN_MINUTE, next); | ||||||||||||||||||||||||||||||||
5 | if (prevDay != null) |
| | ||||||||||||||||||||||||||||||||
6 | result = new Hour(LAST_HOUR_IN_DAY, prevDay); |
| | ||||||||||||||||||||||||||||||||
else | | ||||||||||||||||||||||||||||||||||
7 | result = null; | | |||||||||||||||||||||||||||||||||
8 | return result; |
| 7 | return result; |
Row | Violation |
---|---|
1 | Expression new Hour(this.hour - 1,this.day) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new Second(this.second + 1,getMinute()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression this.hour - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression this.second + 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression getMinute() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
6 | Expression (Minute)getMinute().next() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
7 | Expression getMinute().next() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
8 | Expression getMinute() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
9 | Unmatched statement if(next != null) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Unmatched statement result=new Second(FIRST_SECOND_IN_MINUTE,next); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
11 | Unmatched statement if(prevDay != null) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
12 | Unmatched statement result=new Hour(LAST_HOUR_IN_DAY,prevDay); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
13 | Clone fragment #1 returns variable prevDay with type org.jfree.data.time.Day , while Clone fragment #2 returns variable next with type org.jfree.data.time.Minute |