File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Assertions.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Assertions.java | |||
Method name: void applyAssertions(List)
|
Method name: void applyAssertions(ListIterator)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | getProject().log("Applying assertions", Project.MSG_DEBUG);↵ | 1 | getProject().log("Applying assertions", Project.MSG_DEBUG);↵ | |
2 | Assertions clause = getFinalReference();↵ | 2 | Assertions clause = getFinalReference();↵ | |
3 | //do the system assertions↵ | 3 | //do the system assertions↵ | |
4 | if (Boolean.TRUE.equals(clause.enableSystemAssertions)) {↵ | 4 | if (Boolean.TRUE.equals(clause.enableSystemAssertions)) {↵ | |
5 | getProject().log("Enabling system assertions", Project.MSG_DEBUG);↵ | 5 | getProject().log("Enabling system assertions", Project.MSG_DEBUG);↵ | |
6 | commandList.add("-enablesystemassertions");↵ | 6 | commandIterator.add("-enablesystemassertions");↵ | |
7 | } else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) {↵ | 7 | } else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) {↵ | |
8 | getProject().log("disabling system assertions", Project.MSG_DEBUG);↵ | 8 | getProject().log("disabling system assertions", Project.MSG_DEBUG);↵ | |
9 | commandList.add("-disablesystemassertions");↵ | 9 | commandIterator.add("-disablesystemassertions");↵ | |
10 | }↵ | 10 | }↵ | |
11 | //now any inner assertions↵ | 11 | //now any inner assertions↵ | |
12 | Iterator it = clause.assertionList.iterator();↵ | 12 | Iterator it = clause.assertionList.iterator();↵ | |
13 | while (it.hasNext()) {↵ | 13 | while (it.hasNext()) {↵ | |
14 | BaseAssertion assertion = (BaseAssertion) it.next();↵ | 14 | BaseAssertion assertion = (BaseAssertion) it.next();↵ | |
15 | String arg = assertion.toCommand();↵ | 15 | String arg = assertion.toCommand();↵ | |
16 | getProject().log("adding assertion " + arg, Project.MSG_DEBUG);↵ | 16 | getProject().log("adding assertion " + arg, Project.MSG_DEBUG);↵ | |
17 | commandList.add(arg);↵ | 17 | commandIterator.add(arg);↵ | |
18 | } | 18 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 66 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 25.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | getProject().log("Applying assertions", Project.MSG_DEBUG); | 1 | getProject().log("Applying assertions", Project.MSG_DEBUG); | ||||
2 | Assertions clause = getFinalReference(); | 2 | Assertions clause = getFinalReference(); | ||||
3 | if (Boolean.TRUE.equals(clause.enableSystemAssertions)) | 3 | if (Boolean.TRUE.equals(clause.enableSystemAssertions)) | ||||
4 | getProject().log("Enabling system assertions", Project.MSG_DEBUG); | 4 | getProject().log("Enabling system assertions", Project.MSG_DEBUG); | ||||
|
| 5 | commandIterator.add("-enablesystemassertions"); | ||||
5 | commandList.add("-enablesystemassertions"); |
| | ||||
6 | else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) | 6 | else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) | ||||
7 | getProject().log("disabling system assertions", Project.MSG_DEBUG); | 7 | getProject().log("disabling system assertions", Project.MSG_DEBUG); | ||||
|
| 8 | commandIterator.add("-disablesystemassertions"); | ||||
8 | commandList.add("-disablesystemassertions"); |
| | ||||
9 | Iterator it = clause.assertionList.iterator(); | 9 | Iterator it = clause.assertionList.iterator(); | ||||
10 | while (it.hasNext()) | 10 | while (it.hasNext()) | ||||
11 | BaseAssertion assertion = (BaseAssertion)it.next(); | 11 | BaseAssertion assertion = (BaseAssertion)it.next(); | ||||
12 | String arg = assertion.toCommand(); | 12 | String arg = assertion.toCommand(); | ||||
13 | getProject().log("adding assertion " + arg, Project.MSG_DEBUG); | 13 | getProject().log("adding assertion " + arg, Project.MSG_DEBUG); | ||||
|
| 14 | commandIterator.add(arg); | ||||
14 | commandList.add(arg); |
| |
Row | Violation |
---|---|
1 | Unmatched statement commandIterator.add("-enablesystemassertions"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement commandList.add("-enablesystemassertions"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement commandIterator.add("-disablesystemassertions"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement commandList.add("-disablesystemassertions"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched statement commandIterator.add(arg); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement commandList.add(arg); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |