1251-10-53

StandardDialScale s1 = new StandardDialScale(); StandardDialScale s2 = new StandardDialScale(); assertTrue(s1.equals(s2)); int h1 = s1.hashCode(); int h2 = s2.hashCode(); assertEquals(h1, h2);
TextTitle t1 = new TextTitle(); TextTitle t2 = new TextTitle(); assertTrue(t1.equals(t2)); int h1 = t1.hashCode(); int h2 = t2.hashCode(); assertEquals(h1, h2);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/dial/junit/StandardDialScaleTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/chart/title/junit/TextTitleTests.java
Method name: `void testHashCode()` |  | Method name: `void testHashcode()`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    StandardDialScale s1 = new StandardDialScale();↵

1

    TextTitle t1 = new ↵

2

            StandardDialSca↵

2

    TextTitle();↵

3

    le s2 = new StandardDialScale();↵

3

            TextTitle t2 = new TextTitle();↵

4

            assertTrue(s1.equals(s2));↵

4

            assertTrue(t1.equals(t2));↵

5

            int h1 = s1.hashCode();↵

5

            int h1 = t1.hashCode();↵

6

            int h2 = s2.hashCode();↵

6

            int h2 = t2.hashCode();↵

7

            assertEquals(h1, h2);

7

            assertEquals(h1, h2);

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
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 | 24

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 6
   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) | 0.0
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       StandardDialScale s1 = new StandardDialScale();

   1 | StandardDialScale s1 = new StandardDialScale();
   1 | TextTitle t1 = new TextTitle();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   s1 | t1 | VARIABLE_NAME_MISMATCH

   1

       TextTitle t1 = new TextTitle();

   2

       StandardDialScale s2 = new StandardDialScale();

   2 | StandardDialScale s2 = new StandardDialScale();
   2 | TextTitle t2 = new TextTitle();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   s2 | t2 | VARIABLE_NAME_MISMATCH

   2

       TextTitle t2 = new TextTitle();

   3

       assertTrue(s1.equals(s2));

   3 | assertTrue(s1.equals(s2));
   3 | assertTrue(t1.equals(t2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   s2 | t2 | VARIABLE_NAME_MISMATCH
   s1 | t1 | VARIABLE_NAME_MISMATCH

   3

       assertTrue(t1.equals(t2));

   4

       int h1 = s1.hashCode();

   4 | int h1 = s1.hashCode();
   4 | int h1 = t1.hashCode();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   s1 | t1 | VARIABLE_NAME_MISMATCH

   4

       int h1 = t1.hashCode();

   5

       int h2 = s2.hashCode();

   5 | int h2 = s2.hashCode();
   5 | int h2 = t2.hashCode();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   s2 | t2 | VARIABLE_NAME_MISMATCH

   5

       int h2 = t2.hashCode();

   6

       assertEquals(h1, h2);

   6

       assertEquals(h1, h2);

   Precondition Violations (0)
   Row | Violation
   --- | ---