Font f = getTickLabelFont(); String fName = f.getFontName(); Font newFont = new Font(fName, f.getStyle(), (f.getSize() + delta)); setTickLabelFont(newFont);
MonthDateFormat mf1 = new MonthDateFormat(); MonthDateFormat mf2 = new MonthDateFormat(); assertTrue(mf1.equals(mf2)); int h1 = mf1.hashCode(); int h2 = mf2.hashCode(); assertEquals(h1, h2);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/JThermometer.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/MonthDateFormatTests.java
Method name: void changeTickFontSize(int) Method name: void testHashCode()
Number of AST nodes: 4 Number of AST nodes: 6
1
Font f = getTickLabelFont();
1
MonthDateFormat mf1 = new MonthDateFormat();
2
        String fName = f.getFontName();
2
        MonthDateFormat mf2 = new MonthDateFormat();
3
        Font newFont = new Font(fName, f.getStyle(), (f.getSize() + delta)
3
        assertTrue(mf1.equals(mf2));
4
        int h1 = mf1.hashCode();
4
);
5
        int h2 = mf2.hashCode();
5
        setTickLabelFont(newFont);
6
        assertEquals(h1, h2);
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
Number of node comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                              
    1
    MonthDateFormat mf1 = new MonthDateFormat();
    Preondition Violations
    Unmatched statement MonthDateFormat mf1=new MonthDateFormat(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    MonthDateFormat mf1 = new MonthDateFormat();
    1
    Font f = getTickLabelFont();
                                                              
                                                                                              
    2
    MonthDateFormat mf2 = new MonthDateFormat();
    Preondition Violations
    Unmatched statement MonthDateFormat mf2=new MonthDateFormat(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    MonthDateFormat mf2 = new MonthDateFormat();
    2
    String fName = f.getFontName();
    2
    String fName = f.getFontName();
    Preondition Violations
    Unmatched statement String fName=f.getFontName(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                    
                                                                  
    3
    assertTrue(mf1.equals(mf2));
    Preondition Violations
    Unmatched statement assertTrue(mf1.equals(mf2)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    assertTrue(mf1.equals(mf2));
    3
    Font newFont = new Font(fName, f.getStyle(), (f.getSize() + delta));
    3
    Font newFont = new Font(fName, f.getStyle(), (f.getSize() + delta));
    Preondition Violations
    Unmatched statement Font newFont=new Font(fName,f.getStyle(),(f.getSize() + delta)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                          
                                                      
    4
    int h1 = mf1.hashCode();
                                                      
    5
    int h2 = mf2.hashCode();
    4
    setTickLabelFont(newFont);
    4
    setTickLabelFont(newFont);
    6
    assertEquals(h1, h2);
    Differences
    Expression1Expression2Difference
    setTickLabelFontassertEqualsMETHOD_INVOCATION_NAME_MISMATCH
    setTickLabelFont(newFont)assertEquals(h1,h2)TYPE_COMPATIBLE_REPLACEMENT
    setTickLabelFont(newFont)assertEquals(h1,h2)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression setTickLabelFont(newFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(h1,h2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setTickLabelFont(newFont) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(h1,h2) is a void method call, and thus it cannot be parameterized
    Expression setTickLabelFont(newFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(h1,h2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setTickLabelFont(newFont) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(h1,h2) is a void method call, and thus it cannot be parameterized
    6
    assertEquals(h1, h2);
    Precondition Violations (14)
    Row Violation
    1Unmatched statement MonthDateFormat mf1=new MonthDateFormat(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement MonthDateFormat mf2=new MonthDateFormat(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement String fName=f.getFontName(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement assertTrue(mf1.equals(mf2)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement Font newFont=new Font(fName,f.getStyle(),(f.getSize() + delta)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Expression setTickLabelFont(newFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression assertEquals(h1,h2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression setTickLabelFont(newFont) is a void method call, and thus it cannot be parameterized
    9Expression assertEquals(h1,h2) is a void method call, and thus it cannot be parameterized
    10Expression setTickLabelFont(newFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression assertEquals(h1,h2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression setTickLabelFont(newFont) is a void method call, and thus it cannot be parameterized
    13Expression assertEquals(h1,h2) is a void method call, and thus it cannot be parameterized
    14The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.JThermometer and org.jfree.chart.axis.junit.MonthDateFormatTests do not have a common superclass