1088-1-3

TimeZone zone = TimeZone.getTimeZone("GMT"); Day d1 = new Day(new Date(1078099199999L), zone); Day d2 = new Day(new Date(1078099200000L), zone); assertEquals(MonthConstants.FEBRUARY, d1.getMonth()); assertEquals(1078099199999L, d1.getLastMillisecond(zone)); assertEquals(MonthConstants.MARCH, d2.getMonth()); assertEquals(1078099200000L, d2.getFirstMillisecond(zone));
TimeZone zone = TimeZone.getTimeZone("GMT"); Month m1 = new Month(new Date(951868799999L), zone); Month m2 = new Month(new Date(951868800000L), zone); assertEquals(MonthConstants.FEBRUARY, m1.getMonth()); assertEquals(951868799999L, m1.getLastMillisecond(zone)); assertEquals(MonthConstants.MARCH, m2.getMonth()); assertEquals(951868800000L, m2.getFirstMillisecond(zone));

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

1

    TimeZone zone = TimeZone.getTimeZone("GMT");↵

1

    TimeZone zone = TimeZone.getTimeZone("GMT");↵

2

            Day d1 = new Day(new Date(1078099199999L), zone);↵

2

            Month m1 = new Month(new Date(951868799999L), zone);↵

3

            Day d2 = new Day(new Date(1078099200000L), zone);↵

3

            Month m2 = new Month(new Date(951868800000L), zone);↵

4

            assertEquals(MonthConstants.FEBRUARY, d1.getMonth());↵

4

            assertEquals(MonthConstants.FEBRUARY, m1.getMonth());↵

5

            assertEquals(1078099199999L, d1.getLastMillisecond(zone));↵

5

            assertEquals(951868799999L, m1.getLastMillisecond(zone));↵

6

            assertEquals(MonthConstants.MARCH, d2.getMonth());↵

6

            assertEquals(MonthConstants.MARCH, m2.getMonth());↵

7

            assertEquals(1078099200000L, d2.getFirstMillisecond(zone));

7

            assertEquals(951868800000L, m2.getFirstMillisecond(zone));

See real code fragment |  | See real code fragment

Summary
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 | 28

1. {Non-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) | 0.0
   Clone type | Type 2

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

   1

       TimeZone zone = TimeZone.getTimeZone("GMT");

   1

       TimeZone zone = TimeZone.getTimeZone("GMT");

   2

       Day d1 = new Day(new Date(1078099199999L), zone);

   2 | Day d1 = new Day(new Date(1078099199999L), zone);
   2 | Month m1 = new Month(new Date(951868799999L), zone);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH
   d1 | m1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH
   1078099199999L | 951868799999L | LITERAL_VALUE_MISMATCH

   Preondition Violations
   Expression new Day(new Date(1078099199999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression new Month(new Date(951868799999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   2

       Month m1 = new Month(new Date(951868799999L), zone);

   3

       Day d2 = new Day(new Date(1078099200000L), zone);

   3 | Day d2 = new Day(new Date(1078099200000L), zone);
   3 | Month m2 = new Month(new Date(951868800000L), zone);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH
   d2 | m2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH
   1078099200000L | 951868800000L | LITERAL_VALUE_MISMATCH

   Preondition Violations
   Expression new Day(new Date(1078099200000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression new Month(new Date(951868800000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   3

       Month m2 = new Month(new Date(951868800000L), zone);

   4

       assertEquals(MonthConstants.FEBRUARY, d1.getMonth());

   4 | assertEquals(MonthConstants.FEBRUARY, d1.getMonth());
   4 | assertEquals(MonthConstants.FEBRUARY, m1.getMonth());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d1 | m1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression d1 cannot be unified with expression m1 , because common superclass org.jfree.data.time.RegularTimePeriod does not declare member(s) public int getMonth()

   4

       assertEquals(MonthConstants.FEBRUARY, m1.getMonth());

   5

       assertEquals(1078099199999L, d1.getLastMillisecond(zone));

   5 | assertEquals(1078099199999L, d1.getLastMillisecond(zone));
   5 | assertEquals(951868799999L, m1.getLastMillisecond(zone));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   1078099199999L | 951868799999L | LITERAL_VALUE_MISMATCH
   d1 | m1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH

   5

       assertEquals(951868799999L, m1.getLastMillisecond(zone));

   6

       assertEquals(MonthConstants.MARCH, d2.getMonth());

   6 | assertEquals(MonthConstants.MARCH, d2.getMonth());
   6 | assertEquals(MonthConstants.MARCH, m2.getMonth());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d2 | m2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression d2 cannot be unified with expression m2 , because common superclass org.jfree.data.time.RegularTimePeriod does not declare member(s) public int getMonth()

   6

       assertEquals(MonthConstants.MARCH, m2.getMonth());

   7

       assertEquals(1078099200000L, d2.getFirstMillisecond(zone));

   7 | assertEquals(1078099200000L, d2.getFirstMillisecond(zone));
   7 | assertEquals(951868800000L, m2.getFirstMillisecond(zone));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   1078099200000L | 951868800000L | LITERAL_VALUE_MISMATCH
   d2 | m2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | org.jfree.data.time.Month | SUBCLASS_TYPE_MISMATCH

   7

       assertEquals(951868800000L, m2.getFirstMillisecond(zone));

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Expression new Day(new Date(1078099199999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression new Month(new Date(951868799999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression new Day(new Date(1078099200000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression new Month(new Date(951868800000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression d1 cannot be unified with expression m1 , because common superclass org.jfree.data.time.RegularTimePeriod does not declare member(s) public int getMonth()
   6 | Expression d2 cannot be unified with expression m2 , because common superclass org.jfree.data.time.RegularTimePeriod does not declare member(s) public int getMonth()