try { HTMLParser.getParser(StaticTestClass.class.getName()); fail("Should not have been able to create the parser"); } catch (HTMLParseError e) { if (e.getCause() instanceof ClassCastException) { return; } if (e.getCause() instanceof IllegalAccessException) { return; } throw e; }
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; }
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 testNotCreatableStatic() Method name: void testNotCreatable()
Number of AST nodes: 3 Number of AST nodes: 3
1
try {
1
try {
2
                HTMLParser.getParser(StaticTestClass.class.getName());
2
                HTMLParser.getParser(TestClass.class.getName());
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 ClassCastException) {
5
                if (e.getCause() instanceof 
6
                    return;
7
                }
8
                if (e.getCause() instanceof IllegalAccessException) {
6
InstantiationException) {
9
                    return;
7
                    return;
10
                }
8
                }
11
                throw e;
9
                throw e;
12
            }
10
            }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons1