File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/DateSelector.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/DateSelector.java | |||
Method name: void setParameters(Parameter[])
|
Method name: void setParameters(Parameter[])
|
|||
Number of AST nodes: 2 | Number of AST nodes: 2 | |||
1 | try {↵ | 1 | try {↵ | |
2 | setGranularity(new Integer(parameters[i].getValue()↵ | 2 | setMillis(new Long(parameters[i].getValue()↵ | |
3 | ).intValue());↵ | 3 | ).longValue());↵ | |
4 | } catch (NumberFormatException nfe) {↵ | 4 | } catch (NumberFormatException nfe) {↵ | |
5 | setError("Invalid granularity setting "↵ | 5 | setError("Invalid millisecond setting "↵ | |
6 | + parameters[i].getValue());↵ | 6 | + parameters[i].getValue());↵ | |
7 | } | 7 |
| |
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 6 |
Number of mapped statements | 2 |
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) | 2.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13 | try |
| 6 | try | ||||||||||||||||||||||||||||
14 | setGranularity(new Integer(parameters[i].getValue()).intValue()); |
| 7 | setMillis(new Long(parameters[i].getValue()).longValue()); |
Row | Violation |
---|---|
1 | Expression new Integer(parameters[i].getValue()).intValue() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression new Long(parameters[i].getValue()).longValue() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
3 | Type int of variable new Integer(parameters[i].getValue()).intValue() does not match with type long of variable new Long(parameters[i].getValue()).longValue() |
4 | Expression new Integer(parameters[i].getValue()) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
5 | Expression new Long(parameters[i].getValue()) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
6 | Expression setGranularity(new Integer(parameters[i].getValue()).intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression setMillis(new Long(parameters[i].getValue()).longValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression setGranularity(new Integer(parameters[i].getValue()).intValue()) is a void method call, and thus it cannot be parameterized |
9 | Expression setMillis(new Long(parameters[i].getValue()).longValue()) is a void method call, and thus it cannot be parameterized |