File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/ContainsSelector.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/FilenameSelector.java | |||
Method name: void setParameters(Parameter[])
|
Method name: void setParameters(Parameter[])
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | super.setParameters(parameters);↵ | 1 | super.setParameters(parameters);↵ | |
2 | if (parameters != null) {↵ | 2 | if (parameters != null) {↵ | |
3 | for (int i = 0; i < parameters.length; i++) {↵ | 3 | for (int i = 0; i < parameters.length; i++) {↵ | |
4 | String paramname = parameters[i].getName();↵ | 4 | String paramname = parameters[i].getName();↵ | |
5 | if (CONTAINS_KEY.equalsIgnoreCase(paramname)) {↵ | 5 | if (NAME_KEY.equalsIgnoreCase(paramname)) {↵ | |
6 | setText(parameters[i].getValue());↵ | 6 | setName(parameters[i].getValue());↵ | |
7 | } else if (CASE_KEY.equalsIgnoreCase(paramname)) {↵ | 7 | } else if (CASE_KEY.equalsIgnoreCase(paramname)) {↵ | |
8 | setCasesensitive(Project.toBoolean(↵ | 8 | setCasesensitive(Project.toBoolean(↵ | |
9 | parameters[i].getValue()));↵ | 9 | parameters[i].getValue()));↵ | |
10 | } else if (WHITESPACE_KEY.equalsIgnoreCase(paramname)) {↵ | 10 | } else if (NEGATE_KEY.equalsIgnoreCase(paramname)) {↵ | |
11 | setIgnorewhitespace(Project.toBoolean(↵ | 11 | setNegate(Project.toBoolean(↵ | |
12 | parameters[i].getValue()));↵ | 12 | parameters[i].getValue()));↵ | |
13 | } else {↵ | 13 | } else {↵ | |
14 | setError("Invalid parameter " + paramname);↵ | 14 | setError("Invalid parameter " + paramname);↵ | |
15 | }↵ | 15 | }↵ | |
16 | }↵ | 16 | }↵ | |
17 | } | 17 |
| |
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) | 1.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 42 |
Number of mapped statements | 11 |
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) | 4.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | super.setParameters(parameters); | 1 | super.setParameters(parameters); | |||||||||||||||
2 | if (parameters != null) | 2 | if (parameters != null) | |||||||||||||||
3 | for (int i = 0; i < parameters.length; i++) | 3 | for (int i = 0; i < parameters.length; i++) | |||||||||||||||
4 | String paramname = parameters[i].getName(); | 4 | String paramname = parameters[i].getName(); | |||||||||||||||
5 | if (CONTAINS_KEY.equalsIgnoreCase(paramname)) |
| 5 | if (NAME_KEY.equalsIgnoreCase(paramname)) | ||||||||||||||
6 | setText(parameters[i].getValue()); |
| 6 | setName(parameters[i].getValue()); | ||||||||||||||
7 | else if (CASE_KEY.equalsIgnoreCase(paramname)) | 7 | else if (CASE_KEY.equalsIgnoreCase(paramname)) | |||||||||||||||
8 | setCasesensitive(Project.toBoolean(parameters[i].getValue())); | 8 | setCasesensitive(Project.toBoolean(parameters[i].getValue())); | |||||||||||||||
9 | else if (WHITESPACE_KEY.equalsIgnoreCase(paramname)) |
| 9 | else if (NEGATE_KEY.equalsIgnoreCase(paramname)) | ||||||||||||||
10 | setIgnorewhitespace(Project.toBoolean(parameters[i].getValue())); |
| 10 | setNegate(Project.toBoolean(parameters[i].getValue())); | ||||||||||||||
else | else | |||||||||||||||||
11 | setError("Invalid parameter " + paramname); | 11 | setError("Invalid parameter " + paramname); |
Row | Violation |
---|---|
1 | Expression setText(parameters[i].getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression setName(parameters[i].getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression setText(parameters[i].getValue()) is a void method call, and thus it cannot be parameterized |
4 | Expression setName(parameters[i].getValue()) is a void method call, and thus it cannot be parameterized |
5 | Expression setIgnorewhitespace(Project.toBoolean(parameters[i].getValue())) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression setNegate(Project.toBoolean(parameters[i].getValue())) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression setIgnorewhitespace(Project.toBoolean(parameters[i].getValue())) is a void method call, and thus it cannot be parameterized |
8 | Expression setNegate(Project.toBoolean(parameters[i].getValue())) is a void method call, and thus it cannot be parameterized |