File path: /columba-1.4-src/core-api/src/main/java/org/columba/core/xml/XmlElement.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/config/DefaultItem.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | boolean equal = false;↵ | 1 | boolean equal = false;↵ | |
2 | if ((obj != null) && (obj instanceof XmlElement)) {↵ | 2 | if ((obj != null) && (obj instanceof ↵ | |
3 | XmlElement other = (XmlElement) obj;↵ | |||
4 | if (equals(attributes, other.attributes)↵ | |||
5 | && equals(data, other.data) && equals(name, other.name)↵ | |||
6 | && equals(subElements, other.subElements↵ | 3 | IDefaultItem)) {↵ | |
4 | final DefaultItem other = (DefaultItem) obj;↵ | |||
5 | if ((root == other.root)↵ | |||
7 | )) {↵ | 6 | || ((root != null) && root.equals(other.root))) {↵ | |
8 | equal = true;↵ | 7 | equal = true;↵ | |
9 | }↵ | 8 | }↵ | |
10 | }↵ | 9 | }↵ | |
11 | return equal; | 10 |
| |
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
Number of mapped statements | 5 |
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) | 2.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | boolean equal = false; | 1 | boolean equal = false; | ||||||||||||||||||||||||||
2 | if ((obj != null) && (obj instanceof XmlElement)) |
| 2 | if ((obj != null) && (obj instanceof IDefaultItem)) | |||||||||||||||||||||||||
|
| 3 | final DefaultItem other = (DefaultItem)obj; | ||||||||||||||||||||||||||
3 | XmlElement other = (XmlElement)obj; |
| | ||||||||||||||||||||||||||
4 | if (equals(attributes, other.attributes) && equals(data, other.data) && equals(name, other.name) && equals(subElements, other.subElements)) |
| 4 | if ((root == other.root) || ((root != null) && root.equals(other.root))) | |||||||||||||||||||||||||
5 | equal = true; | 5 | equal = true; | ||||||||||||||||||||||||||
6 | return equal; | 6 | return equal; |
Row | Violation |
---|---|
1 | Type org.columba.core.xml.XmlElement does not match with type org.columa.core.config.IDefaultItem |
2 | Unmatched statement final DefaultItem other=(DefaultItem)obj; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement XmlElement other=(XmlElement)obj; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Expression equals(attributes,other.attributes) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression (root == other.root) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression equals(data,other.data) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression ((root != null) && root.equals(other.root)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression equals(attributes,other.attributes) && equals(data,other.data) && equals(name,other.name)&& equals(subElements,other.subElements) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression (root == other.root) || ((root != null) && root.equals(other.root)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | The refactoring of the clones is infeasible, because classes org.columba.core.xml.XmlElement and org.columba.core.config.DefaultItem do not have a common superclass |