try {
s.isSelected(basedir,filenames[0],files[0]);
fail("SizeSelector did not check for value being in the "
+ "allowable range");
} catch (BuildException be2) {
assertEquals("The value attribute is required, and must "
+ "be positive", be2.getMessage());
}
s = (SizeSelector)getInstance();
try {
s.isSelected(basedir,filenames[0],files[0]);
fail("SizeSelector did not check for required fields");
} catch (BuildException be1) {
assertEquals("The value attribute is required, and must "
+ "be positive", be1.getMessage());
}
s = (SizeSelector)getInstance();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java
|
Method name: void testValidate()
|
|
Method name: void testValidate()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | try {↵ | | 1 | try {↵
|
2 | s.isSelected(basedir,filenames[0],files[0]);↵ | | 2 | s.isSelected(basedir,filenames[0],files[0]);↵
|
3 | fail("SizeSelector did not check for value being in the "↵ | | 3 | fail("SizeSelector did not check for ↵
|
4 | + "allowable range");↵ | | 4 | required fields");↵
|
5 | } catch (BuildException be2) {↵ | | 5 | } catch (BuildException be1) {↵
|
6 | assertEquals("The value attribute is required, and must "↵ | | 6 | assertEquals("The value attribute is required, and must "↵
|
7 | + "be positive", be2.getMessage());↵ | | 7 | + "be positive", be1.getMessage());↵
|
8 | }↵ | | 8 | }↵
|
|
9 | s = (SizeSelector)getInstance(); | | 9 | s = (SizeSelector)getInstance();
|
See real code fragment |
|
See real code fragment |
Summary
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) | 0.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 8.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | try | | 2 | try |
8 | s.isSelected(basedir, filenames[0], files[0]); | | 3 | s.isSelected(basedir, filenames[0], files[0]); |
9 | fail("SizeSelector did not check for value being in the " + "allowable range"); | | 4 | fail("SizeSelector did not check for required fields"); |
10 | s = (SizeSelector)getInstance(); | | 5 | s = (SizeSelector)getInstance(); |
Precondition Violations (0)
Row |
Violation |