TimeZone zone = TimeZone.getTimeZone("Europe/Helsinki"); Day d1 = new Day(new Date(1078091999999L), zone); Day d2 = new Day(new Date(1078092000000L), zone); assertEquals(MonthConstants.FEBRUARY, d1.getMonth()); assertEquals(1078091999999L, d1.getLastMillisecond(zone)); assertEquals(MonthConstants.MARCH, d2.getMonth()); assertEquals(1078092000000L, 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 testDateConstructor2() Method name: void testDateConstructor1()
Number of AST nodes: 7 Number of AST nodes: 7
1
TimeZone zone = TimeZone.getTimeZone("Europe/Helsinki");
1
TimeZone zone = TimeZone.getTimeZone("GMT");
2
        Day d1 = new Day(new Date(1078091999999L), zone);
2
        Month m1 = new Month(new Date(951868799999L), zone);
3
        Day d2 = new Day(new Date(1078092000000L), zone);
3
        Month m2 = new Month(new Date(951868800000L), zone);
4
        assertEquals(MonthConstants.FEBRUARY, d1.getMonth());
4
        assertEquals(MonthConstants.FEBRUARY, m1.getMonth());
5
        assertEquals(1078091999999L, d1.getLastMillisecond(zone));
5
        assertEquals(951868799999L, m1.getLastMillisecond(zone));
6
        assertEquals(MonthConstants.MARCH, d2.getMonth());
6
        assertEquals(MonthConstants.MARCH, m2.getMonth());
7
        assertEquals(1078092000000L, d2.getFirstMillisecond(zone));
7
        assertEquals(951868800000L, m2.getFirstMillisecond(zone));
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 comparisons28
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    TimeZone zone = TimeZone.getTimeZone("Europe/Helsinki");
    1
    TimeZone zone = TimeZone.getTimeZone("Europe/Helsinki");
    1
    TimeZone zone = TimeZone.getTimeZone("GMT");
    Differences
    Expression1Expression2Difference
    "Europe/Helsinki""GMT"LITERAL_VALUE_MISMATCH
    1
    TimeZone zone = TimeZone.getTimeZone("GMT");
    2
    Day d1 = new Day(new Date(1078091999999L), zone);
    2
    Day d1 = new Day(new Date(1078091999999L), zone);
    2
    Month m1 = new Month(new Date(951868799999L), zone);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_TYPE_MISMATCH
    d1m1VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_TYPE_MISMATCH
    1078091999999L951868799999LLITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression new Day(new Date(1078091999999L),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(1078092000000L), zone);
    3
    Day d2 = new Day(new Date(1078092000000L), zone);
    3
    Month m2 = new Month(new Date(951868800000L), zone);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_TYPE_MISMATCH
    d2m2VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_TYPE_MISMATCH
    1078092000000L951868800000LLITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression new Day(new Date(1078092000000L),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
    Expression1Expression2Difference
    d1m1VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_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(1078091999999L, d1.getLastMillisecond(zone));
    5
    assertEquals(1078091999999L, d1.getLastMillisecond(zone));
    5
    assertEquals(951868799999L, m1.getLastMillisecond(zone));
    Differences
    Expression1Expression2Difference
    1078091999999L951868799999LLITERAL_VALUE_MISMATCH
    d1m1VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_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
    Expression1Expression2Difference
    d2m2VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_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(1078092000000L, d2.getFirstMillisecond(zone));
    7
    assertEquals(1078092000000L, d2.getFirstMillisecond(zone));
    7
    assertEquals(951868800000L, m2.getFirstMillisecond(zone));
    Differences
    Expression1Expression2Difference
    1078092000000L951868800000LLITERAL_VALUE_MISMATCH
    d2m2VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Dayorg.jfree.data.time.MonthSUBCLASS_TYPE_MISMATCH
    7
    assertEquals(951868800000L, m2.getFirstMillisecond(zone));
    Precondition Violations (6)
    Row Violation
    1Expression new Day(new Date(1078091999999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new Month(new Date(951868799999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new Day(new Date(1078092000000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new Month(new Date(951868800000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression d1 cannot be unified with expression m1 , because common superclass org.jfree.data.time.RegularTimePeriod does not declare member(s) public int getMonth()
    6Expression d2 cannot be unified with expression m2 , because common superclass org.jfree.data.time.RegularTimePeriod does not declare member(s) public int getMonth()