Font f = getTickLabelFont(); String fName = f.getFontName(); Font newFont = new Font(fName, f.getStyle(), (f.getSize() + delta)); setTickLabelFont(newFont);
CategoryLabelPosition a1 = new CategoryLabelPosition(); CategoryLabelPosition a2 = new CategoryLabelPosition(); assertTrue(a1.equals(a2)); int h1 = a1.hashCode(); int h2 = a2.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/CategoryLabelPositionTests.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
CategoryLabelPosition a1 = new CategoryLabelPosition();
2
        String fName = f.getFontName(
2
        CategoryLabelPosition a2 = new CategoryLabelPosition();
3
);
3
        assertTrue(a1.equals(a2));
4
        Font newFont = new Font(fName, f.getStyle(), (f.getSize() + delta)
4
        int h1 = a1.hashCode();
5
);
5
        int h2 = a2.hashCode();
6
        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
    CategoryLabelPosition a1 = new CategoryLabelPosition();
    Preondition Violations
    Unmatched statement CategoryLabelPosition a1=new CategoryLabelPosition(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    CategoryLabelPosition a1 = new CategoryLabelPosition();
    1
    Font f = getTickLabelFont();
                                                              
                                                                                                                    
    2
    CategoryLabelPosition a2 = new CategoryLabelPosition();
    Preondition Violations
    Unmatched statement CategoryLabelPosition a2=new CategoryLabelPosition(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    CategoryLabelPosition a2 = new CategoryLabelPosition();
    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(a1.equals(a2));
    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 = a1.hashCode();
    Preondition Violations
    Unmatched statement int h1=a1.hashCode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    int h1 = a1.hashCode();
                                                    
    5
    int h2 = a2.hashCode();
    Preondition Violations
    Unmatched statement int h2=a2.hashCode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    int h2 = a2.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 CategoryLabelPosition a1=new CategoryLabelPosition(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement CategoryLabelPosition a2=new CategoryLabelPosition(); 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=a1.hashCode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement int h2=a2.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.axis.junit.CategoryLabelPositionTests do not have a common superclass