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