File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/CustomCategoryURLGenerator.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/CustomXYURLGenerator.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 21 | Number of AST nodes: 21 | |||
1 | if (obj == this) {↵ | 1 | if (obj == this) {↵ | |
2 | return true;↵ | 2 | return true;↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (!(obj instanceof CustomCategoryURLGenerator)) {↵ | 4 | if (!(obj instanceof CustomXYURLGenerator)) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | CustomCategoryURLGenerator generator = (CustomCategoryURLGenerator) obj;↵ | 7 | CustomXYURLGenerator that = (CustomXYURLGenerator) obj;↵ | |
8 | int listCount = getListCount();↵ | 8 | int listCount = getListCount();↵ | |
9 | if (listCount != generator.getListCount()) {↵ | 9 | if (listCount != that.getListCount()) {↵ | |
10 | return false;↵ | 10 | return false;↵ | |
11 | }↵ | 11 | }↵ | |
12 | for (int series = 0; series < listCount; series++) {↵ | 12 | for (int series = 0; series < listCount; series++) {↵ | |
13 | int urlCount = getURLCount(series);↵ | 13 | int urlCount = getURLCount(series);↵ | |
14 | if (urlCount != generator.getURLCount(series)) {↵ | 14 | if (urlCount != that.getURLCount(series)) {↵ | |
15 | return false;↵ | 15 | return false;↵ | |
16 | }↵ | 16 | }↵ | |
17 | for (int item = 0; item < urlCount; item++) {↵ | 17 | for (int item = 0; item < urlCount; item++) {↵ | |
18 | String u1 = getURL(series, item);↵ | 18 | String u1 = getURL(series, item);↵ | |
19 | String u2 = generator.getURL(series, item);↵ | 19 | String u2 = that.getURL(series, item);↵ | |
20 | if (u1 != null) {↵ | 20 | if (u1 != null) {↵ | |
21 | if (!u1.equals(u2)) {↵ | 21 | if (!u1.equals(u2)) {↵ | |
22 | return false;↵ | 22 | return false;↵ | |
23 | }↵ | 23 | }↵ | |
24 | }↵ | 24 | }↵ | |
25 | else {↵ | 25 | else {↵ | |
26 | if (u2 != null) {↵ | 26 | if (u2 != null) {↵ | |
27 | return false;↵ | 27 | return false;↵ | |
28 | }↵ | 28 | }↵ | |
29 | }↵ | 29 | }↵ | |
30 | }↵ | 30 | }↵ | |
31 | }↵ | 31 | }↵ | |
32 | return true; | 32 |
| |
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) | 1.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 56 |
Number of mapped statements | 21 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 7.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (obj == this) | 1 | if (obj == this) | ||||||||||||||||||||
2 | return true; | 2 | return true; | ||||||||||||||||||||
3 | if (!(obj instanceof CustomCategoryURLGenerator)) |
| 3 | if (!(obj instanceof CustomXYURLGenerator)) | |||||||||||||||||||
4 | return false; | 4 | return false; | ||||||||||||||||||||
5 | CustomCategoryURLGenerator generator = (CustomCategoryURLGenerator)obj; |
| 5 | CustomXYURLGenerator that = (CustomXYURLGenerator)obj; | |||||||||||||||||||
6 | int listCount = getListCount(); | 6 | int listCount = getListCount(); | ||||||||||||||||||||
7 | if (listCount != generator.getListCount()) |
| 7 | if (listCount != that.getListCount()) | |||||||||||||||||||
8 | return false; | 8 | return false; | ||||||||||||||||||||
9 | for (int series = 0; series < listCount; series++) | 9 | for (int series = 0; series < listCount; series++) | ||||||||||||||||||||
10 | int urlCount = getURLCount(series); | 10 | int urlCount = getURLCount(series); | ||||||||||||||||||||
11 | if (urlCount != generator.getURLCount(series)) |
| 11 | if (urlCount != that.getURLCount(series)) | |||||||||||||||||||
12 | return false; | 12 | return false; | ||||||||||||||||||||
13 | for (int item = 0; item < urlCount; item++) | 13 | for (int item = 0; item < urlCount; item++) | ||||||||||||||||||||
14 | String u1 = getURL(series, item); | 14 | String u1 = getURL(series, item); | ||||||||||||||||||||
15 | String u2 = generator.getURL(series, item); |
| 15 | String u2 = that.getURL(series, item); | |||||||||||||||||||
16 | if (u1 != null) | 16 | if (u1 != null) | ||||||||||||||||||||
17 | if (!u1.equals(u2)) | 17 | if (!u1.equals(u2)) | ||||||||||||||||||||
18 | return false; | 18 | return false; | ||||||||||||||||||||
else | else | ||||||||||||||||||||||
19 | if (u2 != null) | 19 | if (u2 != null) | ||||||||||||||||||||
20 | return false; | 20 | return false; | ||||||||||||||||||||
21 | return true; | 21 | return true; |
Row | Violation |
---|---|
1 | Expression generator cannot be unified with expression that , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getListCount() |
2 | Expression generator cannot be unified with expression that , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getURLCount(int) |
3 | Expression generator cannot be unified with expression that , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public java.lang.String getURL(int, int) |