TimeZone zone = TimeZone.getTimeZone("Australia/Sydney"); Hour h1 = new Hour(new Date(1014267599999L), zone); Hour h2 = new Hour (new Date(1014267600000L), zone); assertEquals(15, h1.getHour()); assertEquals(1014267599999L, h1.getLastMillisecond(zone)); assertEquals(16, h2.getHour()); assertEquals(1014267600000L, h2.getFirstMillisecond(zone));
TimeZone zone = TimeZone.getTimeZone("GMT"); Millisecond m1 = new Millisecond(new Date(1016729759122L), zone); Millisecond m2 = new Millisecond(new Date(1016729759123L), zone); assertEquals(122, m1.getMillisecond()); assertEquals(1016729759122L, m1.getLastMillisecond(zone)); assertEquals(123, m2.getMillisecond()); assertEquals(1016729759123L, m2.getFirstMillisecond(zone));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/HourTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/MillisecondTests.java
Method name: void testDateConstructor2() Method name: void testDateConstructor1()
Number of AST nodes: 7 Number of AST nodes: 7
1
TimeZone zone = TimeZone.getTimeZone("Australia/Sydney");
1
TimeZone zone = TimeZone.getTimeZone("
2
        Hour h1 = new Hour
2
GMT");
3
(new Date(1014267599999L), zone);
3
        Millisecond m1 = new Millisecond(new Date(1016729759122L), zone);
4
        Hour h2 = new Hour (new Date(1014267600000L), zone);
4
        Millisecond m2 = new Millisecond(new Date(1016729759123L), zone);
5
        assertEquals(15, h1.getHour());
5
        assertEquals(122, m1.getMillisecond());
6
        assertEquals(1014267599999L, h1.getLastMillisecond(zone));
6
        assertEquals(1016729759122L, m1.getLastMillisecond(zone));
7
        assertEquals(16, h2.getHour());
7
        assertEquals(123, m2.getMillisecond());
8
        assertEquals(1014267600000L, h2.getFirstMillisecond(zone));
8
        assertEquals(1016729759123L, 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 statements5
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    TimeZone zone = TimeZone.getTimeZone("Australia/Sydney");
    1
    TimeZone zone = TimeZone.getTimeZone("Australia/Sydney");
    1
    TimeZone zone = TimeZone.getTimeZone("GMT");
    Differences
    Expression1Expression2Difference
    "Australia/Sydney""GMT"LITERAL_VALUE_MISMATCH
    1
    TimeZone zone = TimeZone.getTimeZone("GMT");
    2
    Hour h1 = new Hour(new Date(1014267599999L), zone);
    2
    Hour h1 = new Hour(new Date(1014267599999L), zone);
    2
    Millisecond m1 = new Millisecond(new Date(1016729759122L), zone);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.Hourorg.jfree.data.time.MillisecondSUBCLASS_TYPE_MISMATCH
    h1m1VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.MillisecondSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.MillisecondSUBCLASS_TYPE_MISMATCH
    1014267599999L1016729759122LLITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression new Hour(new Date(1014267599999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Millisecond(new Date(1016729759122L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    Millisecond m1 = new Millisecond(new Date(1016729759122L), zone);
    3
    Hour h2 = new Hour(new Date(1014267600000L), zone);
    3
    Hour h2 = new Hour(new Date(1014267600000L), zone);
    3
    Millisecond m2 = new Millisecond(new Date(1016729759123L), zone);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.Hourorg.jfree.data.time.MillisecondSUBCLASS_TYPE_MISMATCH
    h2m2VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.MillisecondSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.MillisecondSUBCLASS_TYPE_MISMATCH
    1014267600000L1016729759123LLITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression new Hour(new Date(1014267600000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Millisecond(new Date(1016729759123L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    Millisecond m2 = new Millisecond(new Date(1016729759123L), zone);
                                                                                      
    4
    assertEquals(122, m1.getMillisecond());
    Preondition Violations
    Unmatched statement assertEquals(122,m1.getMillisecond()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    assertEquals(122, m1.getMillisecond());
    4
    assertEquals(15, h1.getHour());
    4
    assertEquals(15, h1.getHour());
    Preondition Violations
    Unmatched statement assertEquals(15,h1.getHour()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
    5
    assertEquals(1014267599999L, h1.getLastMillisecond(zone));
    5
    assertEquals(1014267599999L, h1.getLastMillisecond(zone));
    5
    assertEquals(1016729759122L, m1.getLastMillisecond(zone));
    Differences
    Expression1Expression2Difference
    1014267599999L1016729759122LLITERAL_VALUE_MISMATCH
    h1m1VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.MillisecondSUBCLASS_TYPE_MISMATCH
    5
    assertEquals(1016729759122L, m1.getLastMillisecond(zone));
                                                                                      
    6
    assertEquals(123, m2.getMillisecond());
    Preondition Violations
    Unmatched statement assertEquals(123,m2.getMillisecond()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    assertEquals(123, m2.getMillisecond());
    6
    assertEquals(16, h2.getHour());
    6
    assertEquals(16, h2.getHour());
    Preondition Violations
    Unmatched statement assertEquals(16,h2.getHour()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
    7
    assertEquals(1014267600000L, h2.getFirstMillisecond(zone));
    7
    assertEquals(1014267600000L, h2.getFirstMillisecond(zone));
    7
    assertEquals(1016729759123L, m2.getFirstMillisecond(zone));
    Differences
    Expression1Expression2Difference
    1014267600000L1016729759123LLITERAL_VALUE_MISMATCH
    h2m2VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.MillisecondSUBCLASS_TYPE_MISMATCH
    7
    assertEquals(1016729759123L, m2.getFirstMillisecond(zone));
    Precondition Violations (9)
    Row Violation
    1Expression new Hour(new Date(1014267599999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new Millisecond(new Date(1016729759122L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new Hour(new Date(1014267600000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new Millisecond(new Date(1016729759123L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement assertEquals(122,m1.getMillisecond()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement assertEquals(15,h1.getHour()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched statement assertEquals(123,m2.getMillisecond()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement assertEquals(16,h2.getHour()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Clone fragment #1 returns variables h1, h2 , while Clone fragment #2 returns variables m1, m2