File path: /jfreechart-1.0.10/src/org/jfree/data/time/Millisecond.java | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Second.java | |||
Method name: RegularTimePeriod next()
|
Method name: RegularTimePeriod next()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | RegularTimePeriod result = null;↵ | 1 | Second result = null;↵ | |
2 | if (this.millisecond != LAST_MILLISECOND_IN_SECOND) {↵ | 2 | if (this.second != LAST_SECOND_IN_MINUTE) {↵ | |
3 | result = new Millisecond(this.millisecond + 1, getSecond());↵ | 3 | result = new Second(this.second + 1, getMinute());↵ | |
4 | }↵ | 4 | }↵ | |
5 | else {↵ | 5 | else {↵ | |
6 | Second next = (Second) getSecond().next();↵ | 6 | Minute next = (Minute) getMinute().next();↵ | |
7 | if (next != null) {↵ | 7 | if (next != null) {↵ | |
8 | result = new Millisecond(FIRST_MILLISECOND_IN_SECOND, next);↵ | 8 | result = new Second(FIRST_SECOND_IN_MINUTE, next);↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | return result; | 11 |
| |
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 17 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 15.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | RegularTimePeriod result = null; |
| 1 | Second result = null; | |||||||||||||||||||||
2 | if (this.millisecond != LAST_MILLISECOND_IN_SECOND) |
| 2 | if (this.second != LAST_SECOND_IN_MINUTE) | |||||||||||||||||||||
|
| 3 | result = new Second(this.second + 1, getMinute()); | ||||||||||||||||||||||
3 | result = new Millisecond(this.millisecond + 1, getSecond()); |
| | ||||||||||||||||||||||
else | else | ||||||||||||||||||||||||
4 | Second next = (Second)getSecond().next(); |
| 4 | Minute next = (Minute)getMinute().next(); | |||||||||||||||||||||
5 | if (next != null) |
| 5 | if (next != null) | |||||||||||||||||||||
6 | result = new Millisecond(FIRST_MILLISECOND_IN_SECOND, next); |
| 6 | result = new Second(FIRST_SECOND_IN_MINUTE, next); | |||||||||||||||||||||
7 | return result; |
| 7 | return result; |
Row | Violation |
---|---|
1 | Type int of variable this.millisecond does not match with type byte of variable this.second |
2 | Unmatched statement result=new Second(this.second + 1,getMinute()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement result=new Second(this.second + 1,getMinute()); 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 or after the extracted code, because it has dependencies to/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 | Expression new Millisecond(FIRST_MILLISECOND_IN_SECOND,next) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression new Second(FIRST_SECOND_IN_MINUTE,next) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Clone fragment #1 returns variable result with type org.jfree.data.time.RegularTimePeriod , while Clone fragment #2 returns variable result with type org.jfree.data.time.Second |