File path: /columba-1.4-src/contact/src/test/java/org/columba/addressbook/folder/AddContactTest.java | File path: /columba-1.4-src/core/src/test/java/org/columba/core/xml/XmlElementTest.java | |||
Method name: void testAddContact()
|
Method name: void testHashcode()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 7 | |||
1 | ContactModel c = new ContactModel();↵ | |||
2 | c.addEmail(new EmailModel("test@test.de", EmailModel.TYPE_HOME));↵ | |||
3 | c↵ | 1 | XmlElement xml1 = new XmlElement();↵ | |
2 | XmlElement xml2 = new XmlElement();↵ | |||
3 | xml1.setName("ONE");↵ | |||
4 | .setNickName("nickname");↵ | 4 | xml2.setName("↵ | |
5 | Object uid = getSourceFolder().add(c);↵ | |||
6 | assertNotNull(uid);↵ | |||
7 | assertEquals("nextUid", 1, getSourceFolder().getNextMessageUid↵ | 5 | ONE");↵ | |
6 | xml1.addElement(new XmlElement("child1"));↵ | |||
7 | xml2.addElement(new XmlElement("child1"));↵ | |||
8 | assertEquals("The hashcode are not equal", xml2.hashCode(),↵ | |||
8 | ()); | 9 | xml1.hashCode()); | |
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 42 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 6 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 1 | XmlElement xml1 = new XmlElement(); | ||||||||||||||||||||||
1 | ContactModel c = new ContactModel(); |
| | ||||||||||||||||||||||
|
| 2 | XmlElement xml2 = new XmlElement(); | ||||||||||||||||||||||
2 | c.addEmail(new EmailModel("test@test.de", EmailModel.TYPE_HOME)); |
| | ||||||||||||||||||||||
|
| 3 | xml1.setName("ONE"); | ||||||||||||||||||||||
3 | c.setNickName("nickname"); |
| | ||||||||||||||||||||||
|
| 4 | xml2.setName("ONE"); | ||||||||||||||||||||||
4 | Object uid = getSourceFolder().add(c); | | |||||||||||||||||||||||
|
| 5 | xml1.addElement(new XmlElement("child1")); | ||||||||||||||||||||||
|
| 6 | xml2.addElement(new XmlElement("child1")); | ||||||||||||||||||||||
5 | assertNotNull(uid); |
| 7 | assertEquals("The hashcode are not equal", xml2.hashCode(), xml1.hashCode()); | |||||||||||||||||||||
6 | assertEquals("nextUid", 1, getSourceFolder().getNextMessageUid()); | |
Row | Violation |
---|---|
1 | Unmatched statement XmlElement xml1=new XmlElement(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement ContactModel c=new ContactModel(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement XmlElement xml2=new XmlElement(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement c.addEmail(new EmailModel("test@test.de",EmailModel.TYPE_HOME)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched statement xml1.setName("ONE"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement c.setNickName("nickname"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched statement xml2.setName("ONE"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
8 | Unmatched statement xml1.addElement(new XmlElement("child1")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
9 | Unmatched statement xml2.addElement(new XmlElement("child1")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
10 | Expression assertNotNull(uid) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression assertNotNull(uid) is a void method call, and thus it cannot be parameterized |
13 | Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized |
14 | Expression assertNotNull(uid) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression assertNotNull(uid) is a void method call, and thus it cannot be parameterized |
17 | Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized |
18 | The refactoring of the clones is infeasible, because classes org.columba.addressbook.folder.AddContactTest and org.columba.core.xml.XmlElementTest do not have a common superclass |