File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/MacroDef.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/MacroDef.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 15 | |||
1 | if (obj == null) {↵ | 1 | if (obj == null) {↵ | |
2 | return false;↵ | 2 | return false;↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (obj.getClass() != getClass()) {↵ | 4 | if (obj.getClass() != getClass()) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | Attribute other = (Attribute) obj;↵ | 7 | Text other = (Text) obj;↵ | |
8 | if (name == null) {↵ | 8 | if (name == null) {↵ | |
9 | if (other.name != null) {↵ | 9 | if (other.name != null) {↵ | |
10 | return false;↵ | 10 | return false;↵ | |
11 | }↵ | 11 | }↵ | |
12 | } else if (!name.equals(other.name)) {↵ | 12 | } else if (!name.equals(other.name)) {↵ | |
13 | return false;↵ | 13 | return false;↵ | |
14 | }↵ | 14 | }↵ | |
15 | if (defaultValue == null) {↵ | 15 | if (↵ | |
16 | if (other.defaultValue != null) {↵ | |||
17 | ↵ | 16 | optional != other.optional) {↵ | |
18 | return false;↵ | 17 | return false;↵ | |
19 | }↵ | 18 | }↵ | |
20 | } else if (!defaultValue.equals(other.defaultValue)) {↵ | 19 | if (trim != other.trim) {↵ | |
21 | return false;↵ | 20 | return false;↵ | |
22 | }↵ | 21 | }↵ | |
23 | return true; | 22 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 2 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 2 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 2.5 |
Clones location | Clones are in the same java file |
Number of node comparisons | 58 |
Number of mapped statements | 9 |
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) | 1.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (obj == null) | 1 | if (obj == null) | ||||||||||||
2 | return false; |
| 2 | return false; | |||||||||||
3 | if (obj.getClass() != getClass()) |
| 3 | if (obj.getClass() != getClass()) | |||||||||||
4 | return false; |
| 4 | return false; | |||||||||||
| 5 | Text other = (Text)obj; | |||||||||||||
5 | Attribute other = (Attribute)obj; | | |||||||||||||
6 | if (name == null) | 6 | if (name == null) | ||||||||||||
7 | if (other.name != null) |
| 7 | if (other.name != null) | |||||||||||
8 | return false; |
| 8 | return false; | |||||||||||
9 | else if (!name.equals(other.name)) |
| 9 | else if (!name.equals(other.name)) | |||||||||||
10 | return false; |
| 10 | return false; |
Row | Violation |
---|---|
1 | Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass() |
2 | Type org.apache.tools.ant.taskdefs.MacroDef.Attribute of variable other does not match with type org.apache.tools.ant.taskdefs.MacroDef.Text of variable other |
3 | Type org.apache.tools.ant.taskdefs.MacroDef.Attribute of variable other does not match with type org.apache.tools.ant.taskdefs.MacroDef.Text of variable other |
4 | Conditional return false; |
5 | Conditional return false; |
6 | Conditional return false; |
7 | Conditional return false; |
8 | Conditional return false; |
9 | Conditional return false; |
10 | Conditional return false; |
11 | Conditional return false; |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 6 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 6.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (obj == null) | 1 | if (obj == null) | ||||||||||||||||||
2 | return false; |
| 2 | return false; | |||||||||||||||||
3 | if (obj.getClass() != getClass()) |
| 3 | if (obj.getClass() != getClass()) | |||||||||||||||||
4 | return false; |
| 4 | return false; | |||||||||||||||||
| 5 | Text other = (Text)obj; | |||||||||||||||||||
5 | Attribute other = (Attribute)obj; | | |||||||||||||||||||
6 | if (name == null) | | |||||||||||||||||||
7 | if (other.name != null) | | |||||||||||||||||||
8 | return false; |
| | ||||||||||||||||||
9 | else if (!name.equals(other.name)) | | |||||||||||||||||||
10 | return false; |
| | ||||||||||||||||||
11 | if (defaultValue == null) |
| 6 | if (name == null) | |||||||||||||||||
12 | if (other.defaultValue != null) |
| 7 | if (other.name != null) | |||||||||||||||||
13 | return false; |
| 8 | return false; | |||||||||||||||||
14 | else if (!defaultValue.equals(other.defaultValue)) |
| 9 | else if (!name.equals(other.name)) | |||||||||||||||||
15 | return false; |
| 10 | return false; |
Row | Violation |
---|---|
1 | Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass() |
2 | Unmatched return false; |
3 | Unmatched return false; |
4 | Type org.apache.tools.ant.taskdefs.MacroDef.Attribute of variable other does not match with type org.apache.tools.ant.taskdefs.MacroDef.Text of variable other |
5 | Type org.apache.tools.ant.taskdefs.MacroDef.Attribute of variable other does not match with type org.apache.tools.ant.taskdefs.MacroDef.Text of variable other |
6 | Conditional return false; |
7 | Conditional return false; |
8 | Conditional return false; |
9 | Conditional return false; |
10 | Conditional return false; |
11 | Conditional return false; |
12 | Conditional return false; |
13 | Conditional return false; |