File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/CommandlineJava.java | |||
Method name: Object clone()
|
Method name: Object clone()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | try {↵ | 1 | try {↵ | |
2 | JUnitTest t = (JUnitTest) super.clone();↵ | 2 | SysProperties c = (SysProperties) super.clone();↵ | |
3 | t.props = props == null ? null : (Properties) props.clone();↵ | 3 | c.variables = (Vector) variables.clone();↵ | |
4 | t.formatters = (Vector) formatters.clone();↵ | 4 | c.propertySets = (Vector) propertySets.clone();↵ | |
5 | return t;↵ | 5 | return c;↵ | |
6 | } catch (CloneNotSupportedException e) {↵ | 6 | } catch (CloneNotSupportedException e) {↵ | |
7 | // plain impossible↵ | 7 | ↵ | |
8 | return this;↵ | 8 | return ↵ | |
9 | null;↵ | |||
9 | } | 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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 25 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | try |
| 1 | try | ||||||||||||||||||||
|
| 2 | SysProperties c = (SysProperties)super.clone(); | |||||||||||||||||||||
2 | JUnitTest t = (JUnitTest)super.clone(); |
| | |||||||||||||||||||||
| 3 | c.variables = (Vector)variables.clone(); | ||||||||||||||||||||||
3 | t.props = props == null ? null : (Properties)props.clone(); | | ||||||||||||||||||||||
4 | t.formatters = (Vector)formatters.clone(); |
| 4 | c.propertySets = (Vector)propertySets.clone(); | ||||||||||||||||||||
|
| 5 | return c; | |||||||||||||||||||||
5 | return t; |
| |
Row | Violation |
---|---|
1 | Unmatched statement SysProperties c=(SysProperties)super.clone(); 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 |
2 | Unmatched statement JUnitTest t=(JUnitTest)super.clone(); 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 |
3 | Type org.apache.tools.ant.taskdefs.optional.junit.BaseTest of variable t does not match with type org.apache.tools.ant.types.CommandlineJava.SysProperties of variable c |
4 | Unmatched return c; |
5 | Unmatched return t; |