File path: /jfreechart-1.0.10/src/org/jfree/data/time/Month.java | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Week.java | |||
Method name: Month parseMonth(String)
|
Method name: Week parseWeek(String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 6 | |||
1 | month = SerialDate.stringToMonthCode↵ | 1 | if (y != null) {↵ | |
2 | (s1);↵ | 2 | w = Week.stringToWeek(s1);↵ | |
3 | if (month == -1) {↵ | 3 | if (w == -1) {↵ | |
4 | throw new TimePeriodFormatException(↵ | 4 | throw new TimePeriodFormatException(↵ | |
5 | "Can't evaluate the month."↵ | 5 | "Can't evaluate the week.");↵ | |
6 | ↵ | 6 | }↵ | |
7 | );↵ | 7 | result = new Week(w, y);↵ | |
8 | ↵ | 8 | }↵ | |
9 | }↵ | 9 | else {↵ | |
10 | result = new Month(mon↵ | 10 | throw new TimePeriodFormatException(↵ | |
11 | th, year); | 11 | "Can't evaluate the year.");↵ | |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 11 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 17 | w = Week.stringToWeek(s1); | |||||||||||||||||||||||
17 | month = SerialDate.stringToMonthCode(s1); | | |||||||||||||||||||||||
18 | if (month == -1) |
| 18 | if (w == -1) | |||||||||||||||||||||
19 | throw new TimePeriodFormatException("Can't evaluate the month."); |
| 19 | throw new TimePeriodFormatException("Can't evaluate the week."); | |||||||||||||||||||||
20 | result = new Month(month, year); |
| 20 | result = new Week(w, y); | |||||||||||||||||||||
|
| 21 | throw new TimePeriodFormatException("Can't evaluate the year."); |
Row | Violation |
---|---|
1 | Expression new Month(month,year) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new Week(w,y) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched throw new TimePeriodFormatException("Can't evaluate the year."); |
4 | Clone fragment #1 returns variable result with type org.jfree.data.time.Month , while Clone fragment #2 returns variable result with type org.jfree.data.time.Week |