File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/parser/XMLContactDocumentParser.java | File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/parser/XMLContactDocumentParser.java | |||
Method name: Iterator getEmailIterator()
|
Method name: Iterator getInstantMessagingIterator()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | Element child = getParentElement().getChild(VCARD.EMAIL);↵ | 1 | Element child = getParentElement().getChild(VCARD.IM);↵ | |
2 | // if not specified return empty iterator↵ | 2 | // if not specified return empty iterator↵ | |
3 | if (child == null)↵ | 3 | if (child == null)↵ | |
4 | return new Vector().iterator();↵ | 4 | return new Vector().iterator();↵ | |
5 | Iterator it = child.getChildren().iterator();↵ | 5 | Iterator it = child.getChildren().iterator();↵ | |
6 | Vector v = new Vector();↵ | 6 | Vector v = new Vector();↵ | |
7 | while (it.hasNext()) {↵ | 7 | while (it.hasNext()) {↵ | |
8 | Element e = (Element) it.next();↵ | 8 | Element e = (Element) it.next();↵ | |
9 | v.add(new EmailModel(e.getValue(), e.getName()));↵ | 9 | v.add(new InstantMessagingModel(e.getValue(), e.getName()));↵ | |
10 | }↵ | 10 | }↵ | |
11 | return v.iterator(); | 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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 30 |
Number of mapped statements | 9 |
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) | 9.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Element child = getParentElement().getChild(VCARD.EMAIL); |
| 1 | Element child = getParentElement().getChild(VCARD.IM); | |||||||||||||
2 | if (child == null) | 2 | if (child == null) | ||||||||||||||
3 | return new Vector().iterator(); | 3 | return new Vector().iterator(); | ||||||||||||||
4 | Iterator it = child.getChildren().iterator(); | 4 | Iterator it = child.getChildren().iterator(); | ||||||||||||||
5 | Vector v = new Vector(); | 5 | Vector v = new Vector(); | ||||||||||||||
6 | while (it.hasNext()) | 6 | while (it.hasNext()) | ||||||||||||||
7 | Element e = (Element)it.next(); | 7 | Element e = (Element)it.next(); | ||||||||||||||
8 | v.add(new EmailModel(e.getValue(), e.getName())); |
| 8 | v.add(new InstantMessagingModel(e.getValue(), e.getName())); | |||||||||||||
9 | return v.iterator(); | 9 | return v.iterator(); |
Row | Violation |
---|---|
1 | Expression new EmailModel(e.getValue(),e.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new InstantMessagingModel(e.getValue(),e.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type org.columba.addressbook.model.EmailModel of variable new EmailModel(e.getValue(),e.getName()) does not match with type org.columba.addressbook.model.InstantMessagingModel of variable new InstantMessagingModel(e.getValue(),e.getName()) |