try {
reader.setFeature(feature, v);
} catch (SAXNotRecognizedException e) {
log(FEATURE + NOT_RECOGNIZED + feature, Project.MSG_VERBOSE);
return false;
} catch (SAXNotSupportedException e) {
log(FEATURE + NOT_SUPPORTED + feature, Project.MSG_VERBOSE);
return false;
}
try {
reader.setProperty(property, value);
} catch (SAXNotRecognizedException e) {
log(PROPERTY + NOT_RECOGNIZED + property, Project.MSG_VERBOSE);
return false;
} catch (SAXNotSupportedException e) {
log(PROPERTY + NOT_SUPPORTED + property, Project.MSG_VERBOSE);
return false;
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/condition/ParserSupports.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/condition/ParserSupports.java
|
Method name: boolean evalFeature()
|
|
Method name: boolean evalProperty()
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | try {↵ | | 1 | try {↵
|
2 | reader.setFeature(feature, v);↵ | | 2 | reader.setProperty(property, value);↵
|
3 | } catch (SAXNotRecognizedException e) {↵ | | 3 | } catch (SAXNotRecognizedException e) {↵
|
4 | log(FEATURE + NOT_RECOGNIZED + feature, Project.MSG_VERBOSE);↵ | | 4 | log(PROPERTY + NOT_RECOGNIZED + property, Project.MSG_VERBOSE);↵
|
5 | return false;↵ | | 5 | return false;↵
|
6 | } catch (SAXNotSupportedException e) {↵ | | 6 | } catch (SAXNotSupportedException e) {↵
|
7 | log(FEATURE + NOT_SUPPORTED + feature, Project.MSG_VERBOSE);↵ | | 7 | log(PROPERTY + NOT_SUPPORTED + property, Project.MSG_VERBOSE);↵
|
8 | return false;↵ | | 8 | return false;↵
|
9 | } | | 9 | }
|
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.4 |
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) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | try | | 2 | try |
| | | 3 | reader.setProperty(property, value); |
6 | reader.setFeature(feature, v); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement reader.setProperty(property,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 reader.setFeature(feature,v); 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 |