268-5-6

Millisecond m = new Millisecond(750, 55, 1, 2, 7, 7, 1950); TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles"); assertEquals(-614962684250L, m.getLastMillisecond(zone)); // try null calendar boolean pass = false; try { m.getLastMillisecond((TimeZone) null); } catch (NullPointerException e) { pass = true; } assertTrue(pass);
Second s = new Second(55, 1, 2, 7, 7, 1950); TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles"); assertEquals(-614962684001L, s.getLastMillisecond(zone)); // try null calendar boolean pass = false; try { s.getLastMillisecond((TimeZone) null); } catch (NullPointerException e) { pass = true; } assertTrue(pass);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/MillisecondTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/SecondTests.java
Method name: `void testGetLastMillisecondWithTimeZone()` |  | Method name: `void testGetLastMillisecondWithTimeZone()`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    Millisecond m = new Millisecond(750, 55, 1, 2, 7, 7, 1950);↵

1

    Second s = new Second(55, 1, 2, 7, 7, 1950);↵

2

            TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");↵

2

            TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");↵

3

            assertEquals(-614962684250L, m.getLastMillisecond(zone));↵

3

            assertEquals(-614962684001L, s.getLastMillisecond(zone));↵

4

            ↵

4

            ↵

5

            // try null calendar↵

5

            // try null calendar↵

6

            boolean pass = false;↵

6

            boolean pass = false;↵

7

            try {↵

7

            try {↵

8

                m.getLastMillisecond((TimeZone) null);↵

8

                s.getLastMillisecond((TimeZone) null);↵

9

            }↵

9

            }↵

10

            catch (NullPointerException e) {↵

10

            catch (NullPointerException e) {↵

11

                pass = true;↵

11

                pass = true;↵

12

            }↵

12

            }↵

13

            assertTrue(pass);

13

            assertTrue(pass);

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.1
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 21

1. {Refactorable}

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

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

   1

       Millisecond m = new Millisecond(750, 55, 1, 2, 7, 7, 1950);

   1 | Millisecond m = new Millisecond(750, 55, 1, 2, 7, 7, 1950);
   1 | Second s = new Second(55, 1, 2, 7, 7, 1950);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.Millisecond | org.jfree.data.time.Second | SUBCLASS_TYPE_MISMATCH
   m | s | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Millisecond | org.jfree.data.time.Second | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.time.Millisecond | org.jfree.data.time.Second | SUBCLASS_TYPE_MISMATCH
   new Millisecond(750,55,1,2,7,7,1950) | new Second(55,1,2,7,7,1950) | ARGUMENT_NUMBER_MISMATCH

   1

       Second s = new Second(55, 1, 2, 7, 7, 1950);

   2

       TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");

   2

       TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");

   3

       assertEquals(-614962684250L, m.getLastMillisecond(zone));

   3 | assertEquals(-614962684250L, m.getLastMillisecond(zone));
   3 | assertEquals(-614962684001L, s.getLastMillisecond(zone));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   614962684250L | 614962684001L | LITERAL_VALUE_MISMATCH
   m | s | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Millisecond | org.jfree.data.time.Second | SUBCLASS_TYPE_MISMATCH

   3

       assertEquals(-614962684001L, s.getLastMillisecond(zone));

   4

       boolean pass = false;

   4

       boolean pass = false;

   5

       try

   5

       try

   6

       m.getLastMillisecond((TimeZone)null);

   6 | m.getLastMillisecond((TimeZone)null);
   6 | s.getLastMillisecond((TimeZone)null);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   m | s | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Millisecond | org.jfree.data.time.Second | SUBCLASS_TYPE_MISMATCH

   6

       s.getLastMillisecond((TimeZone)null);

   7

       assertTrue(pass);

   7

       assertTrue(pass);

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