Font f = getTickLabelFont(); String fName = f.getFontName(); Font newFont = new Font(fName, f.getStyle(), (f.getSize() + delta)); setTickLabelFont(newFont);
TextTitle t1 = new TextTitle(); TextTitle t2 = new TextTitle(); assertTrue(t1.equals(t2)); int h1 = t1.hashCode(); int h2 = t2.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/title/junit/TitleTests.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
TextTitle t1 = new TextTitle();
2
        String fName = f.getFontName();
2
        TextTitle t2 = new TextTitle();
3
        Font newFont = new Font(fName, f.getStyle(), (f.getSize() + delta)
3
        assertTrue(t1.equals(t2));
4
        int h1 = t1.hashCode();
4
);
5
        int h2 = t2.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
    TextTitle t1 = new TextTitle();
    Preondition Violations
    Unmatched statement TextTitle t1=new TextTitle(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    TextTitle t1 = new TextTitle();
    1
    Font f = getTickLabelFont();
                                                              
                                                                    
    2
    TextTitle t2 = new TextTitle();
    Preondition Violations
    Unmatched statement TextTitle t2=new TextTitle(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    TextTitle t2 = new TextTitle();
    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(t1.equals(t2));
    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 = t1.hashCode();
    Preondition Violations
    Unmatched statement int h1=t1.hashCode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    int h1 = t1.hashCode();
                                                    
    5
    int h2 = t2.hashCode();
    Preondition Violations
    Unmatched statement int h2=t2.hashCode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    int h2 = t2.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 (15)
    Row Violation
    1Unmatched statement TextTitle t1=new TextTitle(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement TextTitle t2=new TextTitle(); 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 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
    5Unmatched statement int h1=t1.hashCode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement int h2=t2.hashCode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Expression setTickLabelFont(newFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression assertEquals(h1,h2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression setTickLabelFont(newFont) is a void method call, and thus it cannot be parameterized
    10Expression assertEquals(h1,h2) is a void method call, and thus it cannot be parameterized
    11Expression setTickLabelFont(newFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression assertEquals(h1,h2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression setTickLabelFont(newFont) is a void method call, and thus it cannot be parameterized
    14Expression assertEquals(h1,h2) is a void method call, and thus it cannot be parameterized
    15The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.JThermometer and org.jfree.chart.title.junit.TitleTests do not have a common superclass