File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/SchemaValidate.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/SchemaValidate.java | |||
Method name: boolean enableXercesSchemaValidation()
|
Method name: boolean enableJAXP12SchemaValidation()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | try {↵ | 1 | try {↵ | |
2 | setFeature(XmlConstants.FEATURE_XSD, true↵ | 2 | //enable XSD↵ | |
3 | );↵ | 3 | setProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_LANGUAGE, XmlConstants.URI_XSD);↵ | |
4 | //set the schema source for the doc↵ | 4 | //set the schema source for the doc↵ | |
5 | setNoNamespaceSchemaProperty(XmlConstants.PROPERTY_NO_NAMESPACE_SCHEMA_LOCATION);↵ | 5 | setNoNamespaceSchemaProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_SOURCE);↵ | |
6 | } catch (BuildException e) {↵ | 6 | } catch (BuildException e) {↵ | |
7 | log(e.toString(), Project.MSG_VERBOSE);↵ | 7 | log(e.toString(), Project.MSG_VERBOSE);↵ | |
8 | return false;↵ | 8 | return false;↵ | |
9 | }↵ | 9 | }↵ | |
10 | return true; | 10 |
| |
See real code fragment | See real code fragment |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | try | 1 | try | ||||||||||||||||||||
2 | setFeature(XmlConstants.FEATURE_XSD, true); |
| 3 | setNoNamespaceSchemaProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_SOURCE); | |||||||||||||||||||
3 | setNoNamespaceSchemaProperty(XmlConstants.PROPERTY_NO_NAMESPACE_SCHEMA_LOCATION); |
| 2 | setProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_LANGUAGE, XmlConstants.URI_XSD); | |||||||||||||||||||
4 | return true; | 4 | return true; |
Row | Violation |
---|---|
1 | Expression setFeature(XmlConstants.FEATURE_XSD,true) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression setFeature(XmlConstants.FEATURE_XSD,true) is a void method call, and thus it cannot be parameterized |
3 | Expression setNoNamespaceSchemaProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_SOURCE) is a void method call, and thus it cannot be parameterized |
4 | Expression setFeature(XmlConstants.FEATURE_XSD,true) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
5 | Expression setFeature(XmlConstants.FEATURE_XSD,true) is a void method call, and thus it cannot be parameterized |
6 | Expression setNoNamespaceSchemaProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_SOURCE) is a void method call, and thus it cannot be parameterized |
7 | Expression setProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_LANGUAGE,XmlConstants.URI_XSD) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
8 | Expression setNoNamespaceSchemaProperty(XmlConstants.PROPERTY_NO_NAMESPACE_SCHEMA_LOCATION) is a void method call, and thus it cannot be parameterized |
9 | Expression setProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_LANGUAGE,XmlConstants.URI_XSD) is a void method call, and thus it cannot be parameterized |
10 | Expression setProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_LANGUAGE,XmlConstants.URI_XSD) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
11 | Expression setNoNamespaceSchemaProperty(XmlConstants.PROPERTY_NO_NAMESPACE_SCHEMA_LOCATION) is a void method call, and thus it cannot be parameterized |
12 | Expression setProperty(XmlConstants.FEATURE_JAXP12_SCHEMA_LANGUAGE,XmlConstants.URI_XSD) is a void method call, and thus it cannot be parameterized |