File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java | |||
Method name: void addConfiguredSection(Section)
|
Method name: void storeAttribute(Attribute)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | String sectionName = section.getName();↵ | |||
2 | if (sectionName == null) {↵ | |||
3 | throw new BuildException("Sections must have a name"↵ | 1 | if (attribute == null) {↵ | |
2 | return;↵ | |||
3 | }↵ | |||
4 | );↵ | 4 | String attributeKey = attribute.getKey();↵ | |
5 | }↵ | 5 | ↵ | |
6 | sections.put(sectionName, section);↵ | 6 | ↵ | |
7 | attributes.put(attributeKey, attribute);↵ | |||
7 | if (!sectionIndex.contains(sectionName)) {↵ | 8 | if (!attributeIndex.contains(attributeKey)) {↵ | |
8 | sectionIndex.addElement(sectionName);↵ | 9 | attributeIndex.addElement(↵ | |
10 | attributeKey);↵ | |||
9 | } | 11 | } | |
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 in the same java file |
Number of node comparisons | 17 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String sectionName = section.getName(); | | ||||||||||||||||||||||
2 | if (sectionName == null) |
| 1 | if (attribute == null) | ||||||||||||||||||||
|
| 2 | return; | |||||||||||||||||||||
3 | throw new BuildException("Sections must have a name"); |
| | |||||||||||||||||||||
| 3 | String attributeKey = attribute.getKey(); | ||||||||||||||||||||||
4 | sections.put(sectionName, section); |
| 4 | attributes.put(attributeKey, attribute); | ||||||||||||||||||||
5 | if (!sectionIndex.contains(sectionName)) |
| 5 | if (!attributeIndex.contains(attributeKey)) | ||||||||||||||||||||
6 | sectionIndex.addElement(sectionName); |
| 6 | attributeIndex.addElement(attributeKey); |
Row | Violation |
---|---|
1 | Type java.lang.String of variable sectionName does not match with type org.apache.tools.ant.taskdefs.Manifest.Attribute of variable attribute |
2 | Unmatched return; |
3 | Unmatched throw new BuildException("Sections must have a name"); |
4 | Type org.apache.tools.ant.taskdefs.Manifest.Section of variable section does not match with type org.apache.tools.ant.taskdefs.Manifest.Attribute of variable attribute |