try {
HTMLParser.getParser(TestClass.class.getName());
fail("Should not have been able to create the parser");
} catch (HTMLParseError e) {
if (e.getCause() instanceof InstantiationException) {
return;
}
throw e;
}
try {
HTMLParser.getParser("java.lang.String");
fail("Should not have been able to create the parser");
} catch (HTMLParseError e) {
if (e.getCause() instanceof ClassCastException) {
return;
}
throw e;
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
|
Method name: void testNotCreatable()
|
|
Method name: void testNotParser()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | try {↵ | | 1 | try {↵
|
2 | HTMLParser.getParser(TestClass.class.getName());↵ | | 2 | HTMLParser.getParser("java.lang.String");↵
|
3 | fail("Should not have been able to create the parser");↵ | | 3 | fail("Should not have been able to create the parser");↵
|
4 | } catch (HTMLParseError e) {↵ | | 4 | } catch (HTMLParseError e) {↵
|
5 | if (e.getCause() instanceof InstantiationException) {↵ | | 5 | if (e.getCause() instanceof ClassCastException) {↵
|
6 | return;↵ | | 6 | return;↵
|
7 | }↵ | | 7 | }↵
|
8 | throw e;↵ | | 8 | throw e;↵
|
9 | } | | 9 | }
|
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 declared in the same class |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
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) | 2.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
2 | HTMLParser.getParser(TestClass.class.getName()); | | 2 | HTMLParser.getParser("java.lang.String"); |
3 | fail("Should not have been able to create the parser"); | | 3 | fail("Should not have been able to create the parser"); |
Precondition Violations (0)
Row |
Violation |