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()); }
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()); }
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 setProperty(String, String) Method name: void setFeature(String, boolean)
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
            xmlReader.setProperty(name, value);
2
            xmlReader.setFeature(feature, 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 property "
7
                    + " doesn't recognize feature "
8
                    + name,
8
                    + feature,
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 property "
15
                    + " doesn't support feature "
16
                    + name,
16
                    + feature,
17
                e,
17
                e,
18
                getLocation());
18
                getLocation());
19
        }
19
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
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. {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)2.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    try
    3
    try
    2
    try
    Differences
    Expression1Expression2Difference
    " doesn't recognize property "" doesn't recognize feature "LITERAL_VALUE_MISMATCH
    namefeatureVARIABLE_NAME_MISMATCH
    " doesn't support property "" doesn't support feature "LITERAL_VALUE_MISMATCH
    namefeatureVARIABLE_NAME_MISMATCH
    2
    try
                                                                                  
    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
    3
    xmlReader.setFeature(feature, value);
    4
    xmlReader.setProperty(name, value);
    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
                                                                              
    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