File path: /jfreechart-1.0.10/src/org/jfree/data/time/Millisecond.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: 7 | Number of AST nodes: 8 | |||
1 | RegularTimePeriod result = null;↵ | |||
1 | Minute result;↵ | |||
2 | if (this.millisecond != FIRST_MILLISECOND_IN_SECOND) {↵ | 2 | if (this.minute != LAST_MINUTE_IN_HOUR) {↵ | |
3 | result = new Millisecond(this.millisecond - 1, getSecond());↵ | 3 | result = new Minute(this.minute + 1, getHour());↵ | |
4 | }↵ | 4 | }↵ | |
5 | else {↵ | 5 | else { // we are at the last minute in the hour...↵ | |
6 | Second previous = (Second) getSecond().previous();↵ | 6 | Hour nextHour = (Hour) getHour().next();↵ | |
7 | if (previous != null) {↵ | 7 | if (nextHour != null) {↵ | |
8 | result = new Millisecond(LAST_MILLISECOND_IN_SECOND, previous)↵ | 8 | result = new Minute(FIRST_MINUTE_IN_HOUR, nextHour);↵ | |
9 | }↵ | |||
10 | else {↵ | |||
9 | ;↵ | 11 | result = null;↵ | |
10 | }↵ | 12 | }↵ | |
11 | }↵ | 13 | }↵ | |
12 | return result; | 14 |
| |
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 | 3 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 9.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Minute result; | |||||||||||||||||||||||||||
1 | RegularTimePeriod result = null; | | |||||||||||||||||||||||||||
2 | if (this.millisecond != FIRST_MILLISECOND_IN_SECOND) |
| 2 | if (this.minute != LAST_MINUTE_IN_HOUR) | |||||||||||||||||||||||||
|
| 3 | result = new Minute(this.minute + 1, getHour()); | ||||||||||||||||||||||||||
3 | result = new Millisecond(this.millisecond - 1, getSecond()); |
| | ||||||||||||||||||||||||||
else | else | ||||||||||||||||||||||||||||
4 | Second previous = (Second)getSecond().previous(); |
| 4 | Hour nextHour = (Hour)getHour().next(); | |||||||||||||||||||||||||
|
| 5 | if (nextHour != null) | ||||||||||||||||||||||||||
|
| 6 | result = new Minute(FIRST_MINUTE_IN_HOUR, nextHour); | ||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||
| 7 | result = null; | |||||||||||||||||||||||||||
5 | if (previous != null) |
| | ||||||||||||||||||||||||||
6 | result = new Millisecond(LAST_MILLISECOND_IN_SECOND, previous); |
| | ||||||||||||||||||||||||||
7 | return result; |
| 8 | return result; |
Row | Violation |
---|---|
1 | Type int of variable this.millisecond does not match with type byte of variable this.minute |
2 | Unmatched statement result=new Minute(this.minute + 1,getHour()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement result=new Minute(this.minute + 1,getHour()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched statement result=new Millisecond(this.millisecond - 1,getSecond()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched statement result=new Millisecond(this.millisecond - 1,getSecond()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
6 | Unmatched statement if(nextHour != null) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement result=new Minute(FIRST_MINUTE_IN_HOUR,nextHour); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | 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 |
9 | Unmatched statement result=new Millisecond(LAST_MILLISECOND_IN_SECOND,previous); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Clone fragment #1 returns variable previous with type org.jfree.data.time.Second , while Clone fragment #2 returns variable nextHour with type org.jfree.data.time.Hour |