try {
xmlReader.setFeature(feature, value);
} catch (SAXNotRecognizedException e) {
throw new BuildException(
"Parser "
+ xmlReader.getClass().getName()
+ " doesn't recognize feature "
+ feature,
e,
getLocation());
} catch (SAXNotSupportedException e) {
throw new BuildException(
"Parser "
+ xmlReader.getClass().getName()
+ " doesn't support feature "
+ feature,
e,
getLocation());
}
try {
xmlReader.setProperty(name, value);
} catch (SAXNotRecognizedException e) {
throw new BuildException(
"Parser "
+ xmlReader.getClass().getName()
+ " doesn't recognize property "
+ name,
e,
getLocation());
} catch (SAXNotSupportedException e) {
throw new BuildException(
"Parser "
+ xmlReader.getClass().getName()
+ " doesn't support property "
+ name,
e,
getLocation());
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
|
Method name: void setFeature(String, boolean)
|
|
Method name: void setProperty(String, String)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | try {↵ | | 1 | try {↵
|
2 | xmlReader.setFeature(feature, value);↵ | | 2 | xmlReader.setProperty(name, value);↵
|
3 | } catch (SAXNotRecognizedException e) {↵ | | 3 | } catch (SAXNotRecognizedException e) {↵
|
4 | throw new BuildException(↵ | | 4 | throw new BuildException(↵
|
5 | "Parser "↵ | | 5 | "Parser "↵
|
6 | + xmlReader.getClass().getName()↵ | | 6 | + xmlReader.getClass().getName()↵
|
7 | + " doesn't recognize feature "↵ | | 7 | + " doesn't recognize property "↵
|
8 | + feature,↵ | | 8 | + name,↵
|
9 | e,↵ | | 9 | e,↵
|
10 | getLocation());↵ | | 10 | getLocation());↵
|
11 | } catch (SAXNotSupportedException e) {↵ | | 11 | } catch (SAXNotSupportedException e) {↵
|
12 | throw new BuildException(↵ | | 12 | throw new BuildException(↵
|
13 | "Parser "↵ | | 13 | "Parser "↵
|
14 | + xmlReader.getClass().getName()↵ | | 14 | + xmlReader.getClass().getName()↵
|
15 | + " doesn't support feature "↵ | | 15 | + " doesn't support property "↵
|
16 | + feature,↵ | | 16 | + name,↵
|
17 | e,↵ | | 17 | e,↵
|
18 | getLocation());↵ | | 18 | getLocation());↵
|
19 | } | | 19 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 4 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | try | | 3 | try |
3 | xmlReader.setFeature(feature, value); | | | |
| | | 4 | xmlReader.setProperty(name, value); |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement xmlReader.setFeature(feature,value); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Unmatched statement xmlReader.setProperty(name,value); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |