File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/PatternSet.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/PatternSet.java | |||
Method name: void addConfiguredPatternset(PatternSet)
|
Method name: void setIncludes(String)
|
|||
Number of AST nodes: 2 | Number of AST nodes: 2 | |||
1 | /** | 1 | /** | |
2 | * This is a patternset nested element. | 2 | * Appends <code>includes</code> to the current list of include patterns. | |
3 | * | 3 | * Patterns may be separated by a comma or a space. | |
4 | * @param p a configured patternset nested element. | 4 | * | |
5 | */ | 5 | * @param includes the string containing the include patterns | |
6 | public void addConfiguredPatternset(PatternSet p) { | 6 | */ | |
7 | if (isReference()) { | 7 | public void setIncludes(String includes) { | |
8 | throw noChildrenAllowed(); | 8 | if (isReference()) { | |
9 | } | 9 | throw tooManyAttributes(); | |
10 | 10 | } | ||
11 | String[] nestedIncludes = p.getIncludePatterns(getProject()); | 11 | if (includes != null && includes.length() > 0) { | |
12 | String[] nestedExcludes = p.getExcludePatterns(getProject()); | 12 | StringTokenizer tok = new StringTokenizer(includes, ", ", false); | |
13 | 13 | while (tok.hasMoreTokens()) { | ||
14 | if (nestedIncludes != null) { | 14 | createInclude().setName(tok.nextToken()); | |
15 | for (int i = 0; i < nestedIncludes.length; i++) { | 15 | } | |
16 | createInclude().setName(nestedIncludes[i]); | 16 | } | |
17 | } | 17 | } | |
18 | } | |||
19 | ||||
20 | if (nestedExcludes != null) { | |||
21 | for (int i = 0; i < nestedExcludes.length; i++) { | |||
22 | createExclude().setName(nestedExcludes[i]); | |||
23 | } | |||
24 | } | |||
25 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 3 |
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) | 0.0 |
Similarity Score | 0.667 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | for (int i = 0; i < nestedIncludes.length; i++) |
| 5 | while (tok.hasMoreTokens()) | ||||||||||||||||||
7 | createInclude().setName(nestedIncludes[i]); |
| 6 | createInclude().setName(tok.nextToken()); |
Row | Violation |
---|---|
1 | Type java.lang.String[] of variable nestedIncludes does not match with type java.lang.String of variable includes |
2 | Type java.lang.String[] of variable nestedIncludes does not match with type java.lang.String of variable includes |
3 | Expression nestedIncludes[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted |