File path: /jfreechart-1.0.10/src/org/jfree/data/time/Minute.java | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Second.java | |||
Method name: RegularTimePeriod previous()
|
Method name: RegularTimePeriod previous()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 7 | |||
1 | Minute result;↵ | 1 | Second result = null;↵ | |
2 | if (this.minute != FIRST_MINUTE_IN_HOUR) {↵ | 2 | if (this.second != FIRST_SECOND_IN_MINUTE) {↵ | |
3 | result = new Minute(this.minute - 1, getHour());↵ | 3 | result = new Second(this.second - 1, getMinute());↵ | |
4 | }↵ | 4 | }↵ | |
5 | else {↵ | 5 | else {↵ | |
6 | Hour h = (Hour) getHour().previous();↵ | 6 | Minute previous = (Minute) getMinute().previous();↵ | |
7 | if (h != null) {↵ | 7 | if (previous != null) {↵ | |
8 | result = new Minute(LAST_MINUTE_IN_HOUR, h);↵ | 8 | result = new ↵ | |
9 | }↵ | |||
10 | else {↵ | |||
11 | result = null;↵ | 9 | Second(LAST_SECOND_IN_MINUTE, previous);↵ | |
12 | }↵ | 10 | }↵ | |
13 | }↵ | 11 | }↵ | |
14 | return result; | 12 |
| |
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.3 |
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) | 11.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Second result = null; | ||||||||||||||||||||||||||||
1 | Minute result; | | ||||||||||||||||||||||||||||
2 | if (this.minute != FIRST_MINUTE_IN_HOUR) |
| 2 | if (this.second != FIRST_SECOND_IN_MINUTE) | ||||||||||||||||||||||||||
3 | result = new Minute(this.minute - 1, getHour()); |
| 3 | result = new Second(this.second - 1, getMinute()); | ||||||||||||||||||||||||||
else | else | |||||||||||||||||||||||||||||
4 | Hour h = (Hour)getHour().previous(); |
| 4 | Minute previous = (Minute)getMinute().previous(); | ||||||||||||||||||||||||||
|
| 5 | if (previous != null) | |||||||||||||||||||||||||||
|
| 6 | result = new Second(LAST_SECOND_IN_MINUTE, previous); | |||||||||||||||||||||||||||
5 | if (h != null) |
| | |||||||||||||||||||||||||||
6 | result = new Minute(LAST_MINUTE_IN_HOUR, h); |
| | |||||||||||||||||||||||||||
else | | |||||||||||||||||||||||||||||
7 | result = null; | | ||||||||||||||||||||||||||||
8 | return result; |
| 7 | return result; |
Row | Violation |
---|---|
1 | Expression result cannot be unified with expression result , because common superclass org.jfree.data.time.RegularTimePeriod does not declare member(s) public org.jfree.data.time.Hour getHour() , public org.jfree.data.time.Minute getMinute() |
2 | Expression new Minute(this.minute - 1,getHour()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new Second(this.second - 1,getMinute()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new Minute(this.minute - 1,getHour()) cannot be unified with expression new Second(this.second - 1,getMinute()) , because common superclass org.jfree.data.time.RegularTimePeriod does not declare member(s) public org.jfree.data.time.Hour getHour() , public org.jfree.data.time.Minute getMinute() |
5 | Expression getHour() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
6 | Expression getMinute() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
7 | Expression (Hour)getHour().previous() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
8 | Expression (Minute)getMinute().previous() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
9 | Expression getHour() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
10 | Expression getMinute() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
11 | Unmatched statement if(previous != 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 Second(LAST_SECOND_IN_MINUTE,previous); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
13 | Unmatched statement if(h != null) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
14 | Unmatched statement result=new Minute(LAST_MINUTE_IN_HOUR,h); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
15 | Clone fragment #1 returns variable h with type org.jfree.data.time.Hour , while Clone fragment #2 returns variable previous with type org.jfree.data.time.Minute |