StandardCategoryItemLabelGenerator g1 = new StandardCategoryItemLabelGenerator(); StandardCategoryItemLabelGenerator g2 = new StandardCategoryItemLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); g1 = new StandardCategoryItemLabelGenerator("{0}", new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); g2 = new StandardCategoryItemLabelGenerator("{0}", new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); g1 = new StandardCategoryItemLabelGenerator("{1}", new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); g2 = new StandardCategoryItemLabelGenerator("{1}", new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); g1 = new StandardCategoryItemLabelGenerator("{2}", new SimpleDateFormat("d-MMM")); assertFalse(g1.equals(g2)); g2 = new StandardCategoryItemLabelGenerator("{2}", new SimpleDateFormat("d-MMM")); assertTrue(g1.equals(g2));
StandardCategoryToolTipGenerator g1 = new StandardCategoryToolTipGenerator(); StandardCategoryToolTipGenerator g2 = new StandardCategoryToolTipGenerator(); assertTrue(g1.equals(g2)); assertTrue(g2.equals(g1)); g1 = new StandardCategoryToolTipGenerator("{0}", new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); g2 = new StandardCategoryToolTipGenerator("{0}", new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); g1 = new StandardCategoryToolTipGenerator("{1}", new DecimalFormat("0.000")); assertFalse(g1.equals(g2)); g2 = new StandardCategoryToolTipGenerator("{1}", new DecimalFormat("0.000")); assertTrue(g1.equals(g2)); g1 = new StandardCategoryToolTipGenerator("{2}", new SimpleDateFormat("d-MMM")); assertFalse(g1.equals(g2)); g2 = new StandardCategoryToolTipGenerator("{2}", new SimpleDateFormat("d-MMM")); assertTrue(g1.equals(g2));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/labels/junit/StandardCategoryItemLabelGeneratorTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/labels/junit/StandardCategoryToolTipGeneratorTests.java
Method name: void testEquals() Method name: void testEquals()
Number of AST nodes: 16 Number of AST nodes: 16
1
StandardCategoryItemLabelGenerator g1
1
StandardCategoryToolTipGenerator g1
2
                = new StandardCategoryItemLabelGenerator();
2
                = new StandardCategoryToolTipGenerator();
3
        StandardCategoryItemLabelGenerator g2
3
        StandardCategoryToolTipGenerator g2
4
                = new StandardCategoryItemLabelGenerator();
4
                = new StandardCategoryToolTipGenerator();
5
        assertTrue(g1.equals(g2));
5
        assertTrue(g1.equals(g2));
6
        assertTrue(g2.equals(g1));
6
        assertTrue(g2.equals(g1));
7
        g1 = new StandardCategoryItemLabelGenerator("{0}",
7
        g1 = new StandardCategoryToolTipGenerator("{0}",
8
                new DecimalFormat("0.000"));
8
                new DecimalFormat("0.000"));
9
        assertFalse(g1.equals(g2));
9
        assertFalse(g1.equals(g2));
10
        g2 = new StandardCategoryItemLabelGenerator("{0}",
10
        g2 = new StandardCategoryToolTipGenerator("{0}",
11
                new DecimalFormat("0.000"));
11
                new DecimalFormat("0.000"));
12
        assertTrue(g1.equals(g2));
12
        assertTrue(g1.equals(g2));
13
        g1 = new StandardCategoryItemLabelGenerator("{1}",
13
        g1 = new StandardCategoryToolTipGenerator("{1}",
14
                new DecimalFormat("0.000"));
14
                new DecimalFormat("0.000"));
15
        assertFalse(g1.equals(g2));
15
        assertFalse(g1.equals(g2));
16
        g2 = new StandardCategoryItemLabelGenerator("{1}",
16
        g2 = new StandardCategoryToolTipGenerator("{1}",
17
                new DecimalFormat("0.000"));
17
                new DecimalFormat("0.000"));
18
        assertTrue(g1.equals(g2));
18
        assertTrue(g1.equals(g2));
19
        g1 = new StandardCategoryItemLabelGenerator("{2}",
19
        g1 = new StandardCategoryToolTipGenerator("{2}",
20
                new SimpleDateFormat("d-MMM"));
20
                new SimpleDateFormat("d-MMM"));
21
        assertFalse(g1.equals(g2));
21
        assertFalse(g1.equals(g2));
22
        g2 = new StandardCategoryItemLabelGenerator("{2}",
22
        g2 = new StandardCategoryToolTipGenerator("{2}",
23
                new SimpleDateFormat("d-MMM"));
23
                new SimpleDateFormat("d-MMM"));
24
        assertTrue(g1.equals(g2));
24
        assertTrue(g1.equals(g2));
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons74
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    StandardCategoryItemLabelGenerator g1 = new StandardCategoryItemLabelGenerator();
    1
    StandardCategoryItemLabelGenerator g1 = new StandardCategoryItemLabelGenerator();
    1
    StandardCategoryToolTipGenerator g1 = new StandardCategoryToolTipGenerator();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new StandardCategoryItemLabelGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new StandardCategoryToolTipGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    StandardCategoryToolTipGenerator g1 = new StandardCategoryToolTipGenerator();
    2
    StandardCategoryItemLabelGenerator g2 = new StandardCategoryItemLabelGenerator();
    2
    StandardCategoryItemLabelGenerator g2 = new StandardCategoryItemLabelGenerator();
    2
    StandardCategoryToolTipGenerator g2 = new StandardCategoryToolTipGenerator();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new StandardCategoryItemLabelGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new StandardCategoryToolTipGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    StandardCategoryToolTipGenerator g2 = new StandardCategoryToolTipGenerator();
    3
    assertTrue(g1.equals(g2));
    3
    assertTrue(g1.equals(g2));
    3
    assertTrue(g1.equals(g2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    3
    assertTrue(g1.equals(g2));
    4
    assertTrue(g2.equals(g1));
    4
    assertTrue(g2.equals(g1));
    4
    assertTrue(g2.equals(g1));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    4
    assertTrue(g2.equals(g1));
    5
    g1 = new StandardCategoryItemLabelGenerator("{0}", new DecimalFormat("0.000"));
    5
    g1 = new StandardCategoryItemLabelGenerator("{0}", new DecimalFormat("0.000"));
    5
    g1 = new StandardCategoryToolTipGenerator("{0}", new DecimalFormat("0.000"));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    5
    g1 = new StandardCategoryToolTipGenerator("{0}", new DecimalFormat("0.000"));
    6
    assertFalse(g1.equals(g2));
    6
    assertFalse(g1.equals(g2));
    6
    assertFalse(g1.equals(g2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    6
    assertFalse(g1.equals(g2));
    7
    g2 = new StandardCategoryItemLabelGenerator("{0}", new DecimalFormat("0.000"));
    7
    g2 = new StandardCategoryItemLabelGenerator("{0}", new DecimalFormat("0.000"));
    7
    g2 = new StandardCategoryToolTipGenerator("{0}", new DecimalFormat("0.000"));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    7
    g2 = new StandardCategoryToolTipGenerator("{0}", new DecimalFormat("0.000"));
    8
    assertTrue(g1.equals(g2));
    8
    assertTrue(g1.equals(g2));
    8
    assertTrue(g1.equals(g2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    8
    assertTrue(g1.equals(g2));
    9
    g1 = new StandardCategoryItemLabelGenerator("{1}", new DecimalFormat("0.000"));
    9
    g1 = new StandardCategoryItemLabelGenerator("{1}", new DecimalFormat("0.000"));
    9
    g1 = new StandardCategoryToolTipGenerator("{1}", new DecimalFormat("0.000"));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    9
    g1 = new StandardCategoryToolTipGenerator("{1}", new DecimalFormat("0.000"));
    10
    assertFalse(g1.equals(g2));
    10
    assertFalse(g1.equals(g2));
    10
    assertFalse(g1.equals(g2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    10
    assertFalse(g1.equals(g2));
    11
    g2 = new StandardCategoryItemLabelGenerator("{1}", new DecimalFormat("0.000"));
    11
    g2 = new StandardCategoryItemLabelGenerator("{1}", new DecimalFormat("0.000"));
    11
    g2 = new StandardCategoryToolTipGenerator("{1}", new DecimalFormat("0.000"));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    11
    g2 = new StandardCategoryToolTipGenerator("{1}", new DecimalFormat("0.000"));
    12
    assertTrue(g1.equals(g2));
    12
    assertTrue(g1.equals(g2));
    12
    assertTrue(g1.equals(g2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    12
    assertTrue(g1.equals(g2));
    13
    g1 = new StandardCategoryItemLabelGenerator("{2}", new SimpleDateFormat("d-MMM"));
    13
    g1 = new StandardCategoryItemLabelGenerator("{2}", new SimpleDateFormat("d-MMM"));
    13
    g1 = new StandardCategoryToolTipGenerator("{2}", new SimpleDateFormat("d-MMM"));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    13
    g1 = new StandardCategoryToolTipGenerator("{2}", new SimpleDateFormat("d-MMM"));
    14
    assertFalse(g1.equals(g2));
    14
    assertFalse(g1.equals(g2));
    14
    assertFalse(g1.equals(g2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    14
    assertFalse(g1.equals(g2));
    15
    g2 = new StandardCategoryItemLabelGenerator("{2}", new SimpleDateFormat("d-MMM"));
    15
    g2 = new StandardCategoryItemLabelGenerator("{2}", new SimpleDateFormat("d-MMM"));
    15
    g2 = new StandardCategoryToolTipGenerator("{2}", new SimpleDateFormat("d-MMM"));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    15
    g2 = new StandardCategoryToolTipGenerator("{2}", new SimpleDateFormat("d-MMM"));
    16
    assertTrue(g1.equals(g2));
    16
    assertTrue(g1.equals(g2));
    16
    assertTrue(g1.equals(g2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.StandardCategoryItemLabelGeneratororg.jfree.chart.labels.StandardCategoryToolTipGeneratorSUBCLASS_TYPE_MISMATCH
    16
    assertTrue(g1.equals(g2));
    Precondition Violations (4)
    Row Violation
    1Expression new StandardCategoryItemLabelGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new StandardCategoryToolTipGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new StandardCategoryItemLabelGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new StandardCategoryToolTipGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted