File path: /apache-ant-1.7.0/src/org/apache/tools/ant/helper/ProjectHelperImpl.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Fstat.java | |||
Method name: void init(String, AttributeList)
|
Method name: void setShowFilter(String)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (key.equals("name")) {↵ | 1 | if (filter.equalsIgnoreCase("all")) {↵ | |
2 | name = value;↵ | 2 | ↵ | |
3 | ↵ | 3 | show = SHOW_ALL;↵ | |
4 | } else if (key.equals("id")) {↵ | 4 | } else if (filter.equals↵ | |
5 | id = value;↵ | |||
6 | ↵ | 5 | IgnoreCase("existing")) {↵ | |
6 | show = SHOW_EXISTING;↵ | |||
7 | } else if (key.equals("basedir")) {↵ | 7 | } else if (filter.equalsIgnoreCase("non-existing")) {↵ | |
8 | baseDir = value;↵ | 8 | show = SHOW_NON_EXISTING;↵ | |
9 | } else {↵ | 9 | } else {↵ | |
10 | throw new SAXParseException("Unexpected attribute \"" + attrs.getName(i) + "\"",↵ | 10 | throw new BuildException("↵ | |
11 | helperImpl.locator);↵ | |||
12 | ↵ | 11 | P4Fstat: ShowFilter should be one of: "↵ | |
12 | + "all, existing, non-existing");↵ | |||
13 | } | 13 |
| |
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 31 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | else if (key.equals("name")) |
| 5 | else if (filter.equalsIgnoreCase("non-existing")) | ||||||||||||||||
| 6 | show = SHOW_NON_EXISTING; | ||||||||||||||||||
| else | |||||||||||||||||||
|
| 7 | throw new BuildException("P4Fstat: ShowFilter should be one of: " + "all, existing, non-existing"); | |||||||||||||||||
11 | name = value; | | ||||||||||||||||||
12 | else if (key.equals("id")) |
| 3 | else if (filter.equalsIgnoreCase("existing")) | ||||||||||||||||
13 | id = value; | | ||||||||||||||||||
14 | else if (key.equals("basedir")) |
| 1 | else if (filter.equalsIgnoreCase("all")) | ||||||||||||||||
| 2 | show = SHOW_ALL; | ||||||||||||||||||
15 | baseDir = value; | | ||||||||||||||||||
else | | |||||||||||||||||||
16 | throw new SAXParseException("Unexpected attribute \"" + attrs.getName(i) + "\"", helperImpl.locator); |
| | |||||||||||||||||
| 4 | show = SHOW_EXISTING; |
Row | Violation |
---|---|
1 | Unmatched throw new BuildException("P4Fstat: ShowFilter should be one of: " + "all, existing, non-existing"); |
2 | Unmatched throw new SAXParseException("Unexpected attribute \"" + attrs.getName(i) + "\"",helperImpl.locator); |