File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/TokenFilter.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/TokenFilter.java | |||
Method name: void initialize()
|
Method name: void initialize()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | if (initialized) {↵ | 1 | if (initialized) {↵ | |
2 | return;↵ | 2 | return;↵ | |
3 | }↵ | 3 | }↵ | |
4 | options = convertRegexOptions(flags);↵ | 4 | options = convertRegexOptions(flags);↵ | |
5 | if (from == null) {↵ | 5 | if (from == null) {↵ | |
6 | throw new BuildException("Missing pattern in replaceregex");↵ | 6 | throw new BuildException("Missing from in containsregex");↵ | |
7 | }↵ | 7 | }↵ | |
8 | regularExpression = new RegularExpression();↵ | 8 | regularExpression = new RegularExpression();↵ | |
9 | regularExpression.setPattern(from);↵ | 9 | regularExpression.setPattern(from);↵ | |
10 | regexp = regularExpression.getRegexp(getProject());↵ | 10 | regexp = regularExpression.getRegexp(getProject());↵ | |
11 | if (to == null) {↵ | 11 | if (to == null) {↵ | |
12 | to = "";↵ | 12 | return;↵ | |
13 | }↵ | 13 | }↵ | |
14 | substitution = new Substitution();↵ | 14 | substitution = new Substitution();↵ | |
15 | substitution.setExpression(to); | 15 |
| |
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.3 |
Clones location | Clones are in the same java file |
Number of node comparisons | 41 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (initialized) | 1 | if (initialized) | |||||||||||
2 | return; | 2 | return; | |||||||||||
3 | options = convertRegexOptions(flags); | 3 | options = convertRegexOptions(flags); | |||||||||||
4 | if (from == null) | 4 | if (from == null) | |||||||||||
5 | throw new BuildException("Missing pattern in replaceregex"); |
| 5 | throw new BuildException("Missing from in containsregex"); | ||||||||||
6 | regularExpression = new RegularExpression(); | 6 | regularExpression = new RegularExpression(); | |||||||||||
7 | regularExpression.setPattern(from); | 7 | regularExpression.setPattern(from); | |||||||||||
8 | regexp = regularExpression.getRegexp(getProject()); | 8 | regexp = regularExpression.getRegexp(getProject()); | |||||||||||
9 | if (to == null) | 9 | if (to == null) | |||||||||||
|
| 10 | return; | |||||||||||
10 | to = ""; |
| | |||||||||||
11 | substitution = new Substitution(); | 11 | substitution = new Substitution(); | |||||||||||
12 | substitution.setExpression(to); | 12 | substitution.setExpression(to); |
Row | Violation |
---|---|
1 | Unmatched return; |
2 | Unmatched statement to=""; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |