Hour h = new Hour(2, 7, 7, 1950); TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles"); assertEquals(-614959200001L, h.getLastMillisecond(zone)); // try null calendar boolean pass = false; try { h.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/HourTests.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
Hour h = new Hour(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(-614959200001L, h.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
            h.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);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons21
  1. {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)19.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Hour h = new Hour(2, 7, 7, 1950);
    1
    Hour h = new Hour(2, 7, 7, 1950);
    1
    Second s = new Second(55, 1, 2, 7, 7, 1950);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.Hourorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    hsVARIABLE_NAME_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    new Hour(2,7,7,1950)new Second(55,1,2,7,7,1950)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new Hour(2,7,7,1950) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Second(55,1,2,7,7,1950) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Hour(2,7,7,1950) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Second(55,1,2,7,7,1950) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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(-614959200001L, h.getLastMillisecond(zone));
    3
    assertEquals(-614959200001L, h.getLastMillisecond(zone));
    3
    assertEquals(-614962684001L, s.getLastMillisecond(zone));
    Differences
    Expression1Expression2Difference
    614959200001L614962684001LLITERAL_VALUE_MISMATCH
    hsVARIABLE_NAME_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    3
    assertEquals(-614962684001L, s.getLastMillisecond(zone));
    4
    boolean pass = false;
    4
    boolean pass = false;
    5
    try
    5
    try
    6
    h.getLastMillisecond((TimeZone)null);
    6
    h.getLastMillisecond((TimeZone)null);
    6
    s.getLastMillisecond((TimeZone)null);
    Differences
    Expression1Expression2Difference
    hsVARIABLE_NAME_MISMATCH
    org.jfree.data.time.Hourorg.jfree.data.time.SecondSUBCLASS_TYPE_MISMATCH
    6
    s.getLastMillisecond((TimeZone)null);
    7
    assertTrue(pass);
    7
    assertTrue(pass);
    Precondition Violations (4)
    Row Violation
    1Expression new Hour(2,7,7,1950) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new Second(55,1,2,7,7,1950) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new Hour(2,7,7,1950) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new Second(55,1,2,7,7,1950) cannot be parameterized, because it has dependencies to/from statements that will be extracted