File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Property.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/SQLExec.java | |||
Method name: void loadUrl(URL)
|
Method name: void printResults(PrintStream)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | InputStream is = url.openStream();↵ | |||
2 | ↵ | 1 | ResultSet rs = statement.getResultSet();↵ | |
3 | try {↵ | 2 | try {↵ | |
4 | props.load(is);↵ | 3 | pr↵ | |
5 | ↵ | 4 | intResults(rs, out);↵ | |
6 | } finally {↵ | 5 | } finally {↵ | |
7 | if (is != null) {↵ | 6 | if (rs != null) {↵ | |
8 | is.close();↵ | 7 | rs.close();↵ | |
9 | }↵ | 8 | }↵ | |
10 | }↵ | 9 | ↵ | |
11 | addProperties(props); | 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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 6 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ResultSet rs = statement.getResultSet(); | ||||||||||||||||||||||||||
5 | try |
| 2 | try | ||||||||||||||||||||||||
6 | props.load(is); |
| 3 | printResults(rs, out); |
Row | Violation |
---|---|
1 | Type java.io.InputStream of variable is does not match with type java.sql.ResultSet of variable rs |
2 | Type java.io.InputStream of variable is does not match with type java.sql.ResultSet of variable rs |
3 | Expression props.load(is) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
4 | Expression printResults(rs,out) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
5 | Expression props.load(is) is a void method call, and thus it cannot be parameterized |
6 | Expression printResults(rs,out) is a void method call, and thus it cannot be parameterized |
7 | Expression props.load(is) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
8 | Expression printResults(rs,out) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
9 | Expression props.load(is) is a void method call, and thus it cannot be parameterized |
10 | Expression printResults(rs,out) is a void method call, and thus it cannot be parameterized |