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
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.8
Clones locationClones are declared in the same class
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    3
    try
    Differences
    Expression1Expression2Difference
    " doesn't recognize feature "" doesn't recognize property "LITERAL_VALUE_MISMATCH
    featurenameVARIABLE_NAME_MISMATCH
    " doesn't support feature "" doesn't support property "LITERAL_VALUE_MISMATCH
    featurenameVARIABLE_NAME_MISMATCH
    3
    try
    3
    xmlReader.setFeature(feature, value);
    3
    xmlReader.setFeature(feature, value);
    Preondition Violations
    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
                                                                                  
                                                                              
    4
    xmlReader.setProperty(name, value);
    Preondition Violations
    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
    4
    xmlReader.setProperty(name, value);
    Precondition Violations (2)
    Row Violation
    1Unmatched 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
    2Unmatched 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