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));
TimeZone zone = TimeZone.getTimeZone("GMT"); Second s1 = new Second(new Date(1016729758999L), zone); Second s2 = new Second(new Date(1016729759000L), zone); assertEquals(58, s1.getSecond()); assertEquals(1016729758999L, s1.getLastMillisecond(zone)); assertEquals(59, s2.getSecond()); assertEquals(1016729759000L, s2.getFirstMillisecond(zone));
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 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
        Millisecond m1 = new Millisecond(new Date(1016729759122L), zone);
2
        Second s1 = new Second(new Date(1016729758999L), zone);
3
        Millisecond m2 = new Millisecond(new Date(1016729759123L), zone);
3
        Second s2 = new Second(new Date(1016729759000L), zone);
4
        assertEquals(122, m1.getMillisecond());
4
        assertEquals(58, s1.getSecond());
5
        assertEquals(1016729759122L, m1.getLastMillisecond(zone));
5
        assertEquals(1016729758999L, s1.getLastMillisecond(zone));
6
        assertEquals(123, m2.getMillisecond());
6
        assertEquals(59, s2.getSecond());
7
        assertEquals(1016729759123L, m2.getFirstMillisecond(zone));
7
        assertEquals(1016729759000L, s2.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("GMT");
    1
    TimeZone zone = TimeZone.getTimeZone("GMT");
    2
    Millisecond m1 = new Millisecond(new Date(1016729759122L), zone);
    2
    Millisecond m1 = new Millisecond(new Date(1016729759122L), zone);
    2
    Second s1 = new Second(new Date(1016729758999L), zone);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.Millisecondorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    m1s1VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    1016729759122L1016729758999LLITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression new Millisecond(new Date(1016729759122L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Second(new Date(1016729758999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    Second s1 = new Second(new Date(1016729758999L), zone);
    3
    Millisecond m2 = new Millisecond(new Date(1016729759123L), zone);
    3
    Millisecond m2 = new Millisecond(new Date(1016729759123L), zone);
    3
    Second s2 = new Second(new Date(1016729759000L), zone);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.Millisecondorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    m2s2VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    1016729759123L1016729759000LLITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression new Millisecond(new Date(1016729759123L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Second(new Date(1016729759000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    Second s2 = new Second(new Date(1016729759000L), zone);
                                                                          
    4
    assertEquals(58, s1.getSecond());
    Preondition Violations
    Unmatched statement assertEquals(58,s1.getSecond()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    assertEquals(58, s1.getSecond());
    4
    assertEquals(122, m1.getMillisecond());
    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
                                                                                      
    5
    assertEquals(1016729759122L, m1.getLastMillisecond(zone));
    5
    assertEquals(1016729759122L, m1.getLastMillisecond(zone));
    5
    assertEquals(1016729758999L, s1.getLastMillisecond(zone));
    Differences
    Expression1Expression2Difference
    1016729759122L1016729758999LLITERAL_VALUE_MISMATCH
    m1s1VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    5
    assertEquals(1016729758999L, s1.getLastMillisecond(zone));
                                                                          
    6
    assertEquals(59, s2.getSecond());
    Preondition Violations
    Unmatched statement assertEquals(59,s2.getSecond()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    assertEquals(59, s2.getSecond());
    6
    assertEquals(123, m2.getMillisecond());
    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
                                                                                      
    7
    assertEquals(1016729759123L, m2.getFirstMillisecond(zone));
    7
    assertEquals(1016729759123L, m2.getFirstMillisecond(zone));
    7
    assertEquals(1016729759000L, s2.getFirstMillisecond(zone));
    Differences
    Expression1Expression2Difference
    1016729759123L1016729759000LLITERAL_VALUE_MISMATCH
    m2s2VARIABLE_NAME_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    7
    assertEquals(1016729759000L, s2.getFirstMillisecond(zone));
    Precondition Violations (9)
    Row Violation
    1Expression new Millisecond(new Date(1016729759122L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new Second(new Date(1016729758999L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new Millisecond(new Date(1016729759123L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new Second(new Date(1016729759000L),zone) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement assertEquals(58,s1.getSecond()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched 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
    7Unmatched statement assertEquals(59,s2.getSecond()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched 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
    9Clone fragment #1 returns variables m1, m2 , while Clone fragment #2 returns variables s1, s2