File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Extension.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Specification.java | |||
Method name: Compatibility getCompatibilityWith(Extension)
|
Method name: Compatibility getCompatibilityWith(Specification)
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | if (!extensionName.equals(required.getExtensionName())) {↵ | 1 | if (!specificationTitle.equals(other.getSpecificationTitle())) {↵ | |
2 | return INCOMPATIBLE;↵ | 2 | return INCOMPATIBLE;↵ | |
3 | }↵ | 3 | }↵ | |
4 | // Available specification version must be >= required↵ | 4 | // Available specification version must be >= required↵ | |
5 | final DeweyDecimal requiredSpecificationVersion↵ | 5 | final DeweyDecimal otherSpecificationVersion↵ | |
6 | = required.getSpecificationVersion();↵ | 6 | = other.getSpecificationVersion();↵ | |
7 | if (null != requiredSpecificationVersion) {↵ | 7 | if (null != specificationVersion) {↵ | |
8 | if (null == specificationVersion↵ | 8 | if (null == otherSpecificationVersion↵ | |
9 | || !isCompatible(specificationVersion, requiredSpecificationVersion)) {↵ | 9 | || !isCompatible(specificationVersion, otherSpecificationVersion)) {↵ | |
10 | return REQUIRE_SPECIFICATION_UPGRADE;↵ | 10 | return REQUIRE_SPECIFICATION_UPGRADE;↵ | |
11 | }↵ | 11 | }↵ | |
12 | }↵ | 12 | }↵ | |
13 | // Implementation Vendor ID must match↵ | 13 | // Implementation Vendor ID must match↵ | |
14 | final String requiredImplementationVendorID↵ | 14 | final String otherImplementationVendor↵ | |
15 | = required.getImplementationVendorID();↵ | 15 | = other.getImplementationVendor();↵ | |
16 | if (null != requiredImplementationVendorID) {↵ | 16 | if (null != implementationVendor) {↵ | |
17 | if (null == implementationVendorID↵ | 17 | if (null == otherImplementationVendor↵ | |
18 | || !implementationVendorID.equals(requiredImplementationVendorID)) {↵ | 18 | || !implementationVendor.equals(otherImplementationVendor)) {↵ | |
19 | return REQUIRE_VENDOR_SWITCH;↵ | 19 | return REQUIRE_VENDOR_SWITCH;↵ | |
20 | }↵ | 20 | }↵ | |
21 | }↵ | 21 | }↵ | |
22 | // Implementation version must be >= required↵ | 22 | // Implementation version must be >= required↵ | |
23 | final DeweyDecimal requiredImplementationVersion↵ | 23 | final String otherImplementationVersion↵ | |
24 | = required.getImplementationVersion();↵ | 24 | = other.getImplementationVersion();↵ | |
25 | if (null != requiredImplementationVersion) {↵ | 25 | if (null != implementationVersion) {↵ | |
26 | if (null == implementationVersion↵ | 26 | if (null == otherImplementationVersion↵ | |
27 | || !isCompatible(implementationVersion, requiredImplementationVersion)) {↵ | 27 | || !implementationVersion.equals(otherImplementationVersion)) {↵ | |
28 | return REQUIRE_IMPLEMENTATION_UPGRADE;↵ | 28 | return REQUIRE_IMPLEMENTATION_CHANGE;↵ | |
29 | }↵ | 29 | }↵ | |
30 | }↵ | 30 | }↵ | |
31 | // This available optional package satisfies the requirements↵ | 31 | // This available optional package satisfies the requirements↵ | |
32 | return COMPATIBLE; | 32 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 2 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 2 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 4.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 47 |
Number of mapped statements | 7 |
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) | 3.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | final DeweyDecimal requiredSpecificationVersion = required.getSpecificationVersion(); |
| 3 | final DeweyDecimal otherSpecificationVersion = other.getSpecificationVersion(); | |||||||||||||||||
4 | if (null != requiredSpecificationVersion) |
| 4 | if (null != specificationVersion) | |||||||||||||||||
5 | if (null == specificationVersion || !isCompatible(specificationVersion, requiredSpecificationVersion)) |
| 5 | if (null == otherSpecificationVersion || !isCompatible(specificationVersion, otherSpecificationVersion)) | |||||||||||||||||
6 | return REQUIRE_SPECIFICATION_UPGRADE; | 6 | return REQUIRE_SPECIFICATION_UPGRADE; | ||||||||||||||||||
| 7 | final String otherImplementationVendor = other.getImplementationVendor(); | |||||||||||||||||||
7 | final String requiredImplementationVendorID = required.getImplementationVendorID(); | | |||||||||||||||||||
8 | if (null != requiredImplementationVendorID) |
| 8 | if (null != implementationVendor) | |||||||||||||||||
9 | if (null == implementationVendorID || !implementationVendorID.equals(requiredImplementationVendorID)) |
| 9 | if (null == otherImplementationVendor || !implementationVendor.equals(otherImplementationVendor)) | |||||||||||||||||
10 | return REQUIRE_VENDOR_SWITCH; | 10 | return REQUIRE_VENDOR_SWITCH; |
Row | Violation |
---|---|
1 | Type org.apache.tools.ant.taskdefs.optional.extension.Extension of variable required does not match with type org.apache.tools.ant.taskdefs.optional.extension.Specification of variable other |
2 | Expression requiredSpecificationVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression otherSpecificationVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression requiredSpecificationVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression otherSpecificationVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | final DeweyDecimal requiredSpecificationVersion = required.getSpecificationVersion(); |
| 3 | final DeweyDecimal otherSpecificationVersion = other.getSpecificationVersion(); | ||||||||||||||||||
4 | if (null != requiredSpecificationVersion) | | ||||||||||||||||||||
5 | if (null == specificationVersion || !isCompatible(specificationVersion, requiredSpecificationVersion)) | | ||||||||||||||||||||
6 | return REQUIRE_SPECIFICATION_UPGRADE; |
| | |||||||||||||||||||
| 7 | final String otherImplementationVendor = other.getImplementationVendor(); | ||||||||||||||||||||
7 | final String requiredImplementationVendorID = required.getImplementationVendorID(); | | ||||||||||||||||||||
8 | if (null != requiredImplementationVendorID) |
| 8 | if (null != implementationVendor) | ||||||||||||||||||
9 | if (null == implementationVendorID || !implementationVendorID.equals(requiredImplementationVendorID)) |
| 9 | if (null == otherImplementationVendor || !implementationVendor.equals(otherImplementationVendor)) | ||||||||||||||||||
10 | return REQUIRE_VENDOR_SWITCH; | 10 | return REQUIRE_VENDOR_SWITCH; | |||||||||||||||||||
11 | final DeweyDecimal requiredImplementationVersion = required.getImplementationVersion(); | | ||||||||||||||||||||
12 | if (null != requiredImplementationVersion) |
| 4 | if (null != specificationVersion) | ||||||||||||||||||
13 | if (null == implementationVersion || !isCompatible(implementationVersion, requiredImplementationVersion)) |
| 5 | if (null == otherSpecificationVersion || !isCompatible(specificationVersion, otherSpecificationVersion)) | ||||||||||||||||||
14 | return REQUIRE_IMPLEMENTATION_UPGRADE; |
| 6 | return REQUIRE_SPECIFICATION_UPGRADE; |
Row | Violation |
---|---|
1 | Type org.apache.tools.ant.taskdefs.optional.extension.Extension of variable required does not match with type org.apache.tools.ant.taskdefs.optional.extension.Specification of variable other |
2 | Unmatched return REQUIRE_SPECIFICATION_UPGRADE; |
3 | Expression otherSpecificationVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression otherSpecificationVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables requiredSpecificationVersion , while Clone fragment #2 returns variables |