File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Specification.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Specification.java | |||
Method name: Specification getSpecification(String, Attributes)
|
Method name: Specification getSpecification(String, Attributes)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | if (null == specVendor) {↵ | |||
2 | throw new ParseException(MISSING + SPECIFICATION_VENDOR, 0);↵ | |||
3 | }↵ | |||
4 | final String specVersion↵ | |||
5 | = getTrimmedString(attributes.getValue(SPECIFICATION_VERSION));↵ | |||
1 | if (null == specVersion) {↵ | 6 | if (null == specVersion) {↵ | |
2 | throw new ParseException(MISSING + SPECIFICATION_VERSION, 0);↵ | 7 | throw new ParseException(MISSING + SPECIFICATION_VERSION, 0);↵ | |
3 | }↵ | 8 | }↵ | |
4 | final String impTitle↵ | 9 | final String impTitle↵ | |
5 | = getTrimmedString(attributes.getValue(IMPLEMENTATION_TITLE));↵ | 10 | = getTrimmedString(attributes.getValue(IMPLEMENTATION_TITLE));↵ | |
6 | if (null == impTitle) {↵ | 11 | if (null == impTitle) {↵ | |
7 | throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0);↵ | 12 | throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0);↵ | |
8 | }↵ | 13 | }↵ | |
9 | final String impVersion↵ | 14 | final String impVersion↵ | |
10 | = getTrimmedString(attributes.getValue(IMPLEMENTATION_VERSION));↵ | 15 | = getTrimmedString(attributes.getValue(IMPLEMENTATION_VERSION));↵ | |
11 | if (null == impVersion) {↵ | 16 | if (null == impVersion) {↵ | |
12 | throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0);↵ | 17 | throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0);↵ | |
13 | }↵ | 18 |
| |
14 | final String impVendor↵ | |||
15 | = getTrimmedString(attributes.getValue(IMPLEMENTATION_VENDOR));↵ | |||
16 | if (null == impVendor) {↵ | |||
17 | throw new ParseException(MISSING + IMPLEMENTATION_VENDOR, 0);↵ | |||
18 | } | |||
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.6 |
Clones location | Clones are in the same method |
Number of node comparisons | 55 |
Number of mapped statements | 11 |
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) | 2.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | if (null == specVersion) | 8 | if (null == specVersion) | ||||||||||||||
9 | throw new ParseException(MISSING + SPECIFICATION_VERSION, 0); | 9 | throw new ParseException(MISSING + SPECIFICATION_VERSION, 0); | ||||||||||||||
10 | final String impTitle = getTrimmedString(attributes.getValue(IMPLEMENTATION_TITLE)); | 10 | final String impTitle = getTrimmedString(attributes.getValue(IMPLEMENTATION_TITLE)); | ||||||||||||||
11 | if (null == impTitle) | 11 | if (null == impTitle) | ||||||||||||||
12 | throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0); | 12 | throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0); | ||||||||||||||
13 | final String impVersion = getTrimmedString(attributes.getValue(IMPLEMENTATION_VERSION)); | 13 | final String impVersion = getTrimmedString(attributes.getValue(IMPLEMENTATION_VERSION)); | ||||||||||||||
14 | if (null == impVersion) | 14 | if (null == impVersion) | ||||||||||||||
15 | throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0); | 15 | throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0); | ||||||||||||||
16 | final String impVendor = getTrimmedString(attributes.getValue(IMPLEMENTATION_VENDOR)); |
| 7 | final String specVersion = getTrimmedString(attributes.getValue(SPECIFICATION_VERSION)); | |||||||||||||
17 | if (null == impVendor) |
| 5 | if (null == specVendor) | |||||||||||||
18 | throw new ParseException(MISSING + IMPLEMENTATION_VENDOR, 0); |
| 6 | throw new ParseException(MISSING + SPECIFICATION_VENDOR, 0); |
Row | Violation |
---|---|
1 | Expression impVendor cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Clone fragment #1 returns variables impTitle, impVersion, impVendor , while Clone fragment #2 returns variables specVersion, impTitle, impVersion |