ContactModel c = new ContactModel(); c.addEmail(new EmailModel("test@test.de", EmailModel.TYPE_HOME)); c.setNickName("nickname"); String uid = getSourceFolder().add(c); getSourceFolder().remove(uid); assertEquals("folder contact count == 0", 0, getSourceFolder().count());
XmlElement xml1 = new XmlElement(); XmlElement xml2 = new XmlElement(); xml1.setName("ONE"); xml2.setName("ONE"); xml1.addElement(new XmlElement("child1")); xml2.addElement(new XmlElement("child1")); assertEquals("The hashcode are not equal", xml2.hashCode(), xml1.hashCode());
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/test/java/org/columba/addressbook/folder/RemoveContactTest.java File path: /columba-1.4-src/core/src/test/java/org/columba/core/xml/XmlElementTest.java
Method name: void testRemoveObject() 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
		String uid = getSourceFolder().add(c);
6
		
7
		getSourceFolder().remove(uid);
8
		assertEquals("folder contact count == 0", 0, getSourceFol
5
ONE");
6
        xml1.addElement(new XmlElement("child1"));
7
        xml2.addElement(new XmlElement("child1"));
9
der().count
8
        assertEquals("The hashcode are not equal", xml2.hashCode(),
10
());
9
            xml1.hashCode());
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons39
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                            
    1
    XmlElement xml1 = new XmlElement();
    1
    ContactModel c = new ContactModel();
                                                                              
                                                                            
    2
    XmlElement xml2 = new XmlElement();
                                                  
    3
    xml1.setName("ONE");
                                                                                              
    5
    xml1.addElement(new XmlElement("child1"));
                                                                                              
    6
    xml2.addElement(new XmlElement("child1"));
    2
    c.addEmail(new EmailModel("test@test.de", EmailModel.TYPE_HOME));
    2
    c.addEmail(new EmailModel("test@test.de", EmailModel.TYPE_HOME));
    7
    assertEquals("The hashcode are not equal", xml2.hashCode(), xml1.hashCode());
    Differences
    Expression1Expression2Difference
    addEmailassertEqualsMETHOD_INVOCATION_NAME_MISMATCH
    c.addEmail(new EmailModel("test@test.de",EmailModel.TYPE_HOME))assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode())ARGUMENT_NUMBER_MISMATCH
    cMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    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
    Expression c.addEmail(new EmailModel("test@test.de",EmailModel.TYPE_HOME)) is a void method call, and thus it cannot be parameterized
    Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized
    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
    Expression c.addEmail(new EmailModel("test@test.de",EmailModel.TYPE_HOME)) is a void method call, and thus it cannot be parameterized
    Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized
    7
    assertEquals("The hashcode are not equal", xml2.hashCode(), xml1.hashCode());
    3
    c.setNickName("nickname");
                                                              
    4
    String uid = getSourceFolder().add(c);
                                                                                  
    5
    getSourceFolder().remove(uid);
                                                                      
    6
    assertEquals("folder contact count == 0", 0, getSourceFolder().count());
    6
    assertEquals("folder contact count == 0", 0, getSourceFolder().count());
    4
    xml2.setName("ONE");
    Differences
    Expression1Expression2Difference
    assertEqualssetNameMETHOD_INVOCATION_NAME_MISMATCH
    assertEquals("folder contact count == 0",0,getSourceFolder().count())xml2.setName("ONE")ARGUMENT_NUMBER_MISMATCH
    xml2MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression assertEquals("folder contact count == 0",0,getSourceFolder().count()) is a void method call, and thus it cannot be parameterized
    Expression xml2.setName("ONE") is a void method call, and thus it cannot be parameterized
    Expression assertEquals("folder contact count == 0",0,getSourceFolder().count()) is a void method call, and thus it cannot be parameterized
    Expression xml2.setName("ONE") is a void method call, and thus it cannot be parameterized
    4
    xml2.setName("ONE");
    Precondition Violations (10)
    Row Violation
    1Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression c.addEmail(new EmailModel("test@test.de",EmailModel.TYPE_HOME)) is a void method call, and thus it cannot be parameterized
    3Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized
    4Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression c.addEmail(new EmailModel("test@test.de",EmailModel.TYPE_HOME)) is a void method call, and thus it cannot be parameterized
    6Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized
    7Expression assertEquals("folder contact count == 0",0,getSourceFolder().count()) is a void method call, and thus it cannot be parameterized
    8Expression xml2.setName("ONE") is a void method call, and thus it cannot be parameterized
    9Expression assertEquals("folder contact count == 0",0,getSourceFolder().count()) is a void method call, and thus it cannot be parameterized
    10Expression xml2.setName("ONE") is a void method call, and thus it cannot be parameterized