XYSeries s1 = new XYSeries("S1"); s1.add(1.0, 1.1); s1.add(2.0, null); s1.add(3.0, 3.3); XYSeriesCollection dataset = new XYSeriesCollection(s1); Range r = DatasetUtilities.iterateRangeBounds(dataset); assertEquals(1.1, r.getLowerBound(), EPSILON); assertEquals(3.3, r.getUpperBound(), EPSILON);
XYDataItem i1 = new XYDataItem(1.0, 1.1); XYDataItem i2 = new XYDataItem(1.0, 1.1); assertTrue(i1.equals(i2)); assertTrue(i2.equals(i1)); i1.setY(new Double(9.9)); assertFalse(i1.equals(i2)); i2.setY(new Double(9.9)); assertTrue(i1.equals(i2));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/general/junit/DatasetUtilitiesTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYDataItemTests.java
Method name: void testIterateRangeBounds2() Method name: void testEquals()
Number of AST nodes: 8 Number of AST nodes: 8
1
XYSeries s1 = new XYSeries("S1");
1
XY
2
        s1.add(1.0, 1.1);
3
        s1.add(2.0, null);
4
        s1.add(3.0, 3.3
2
DataItem i1 = new XYDataItem(1.0, 1.1);
3
        XYDataItem i2 = new XYDataItem(1.0, 1.1);
4
        assertTrue(i1.equals(i2));
5
);
5
        assertTrue(i2.equals(i1));
6
        XYSeriesCollection dataset = new XYSeriesCollection(s1);
6
        
7
        Range r = DatasetUtilities.iterateRangeBounds(dataset
7
i1.setY(new Double(9.9));
8
);
8
        assertFalse(i1.equals(i2));
9
        assertEquals(1.1, r.getLowerBound(), EPSILON);
9
        
10
        assertEquals(3.3, r.getUpperBound(), EPSILON
10
i2.setY(new Double(9.9));
11
);
11
        assertTrue(i1.equals(i2));
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 having the same super class
Number of node comparisons64
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                      
    1
    XYDataItem i1 = new XYDataItem(1.0, 1.1);
    Preondition Violations
    Unmatched statement XYDataItem i1=new XYDataItem(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    XYDataItem i1 = new XYDataItem(1.0, 1.1);
    1
    XYSeries s1 = new XYSeries("S1");
    1
    XYSeries s1 = new XYSeries("S1");
    Preondition Violations
    Unmatched statement XYSeries s1=new XYSeries("S1"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                        
                                                                                      
    2
    XYDataItem i2 = new XYDataItem(1.0, 1.1);
    Preondition Violations
    Unmatched statement XYDataItem i2=new XYDataItem(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    XYDataItem i2 = new XYDataItem(1.0, 1.1);
    2
    s1.add(1.0, 1.1);
    2
    s1.add(1.0, 1.1);
    Preondition Violations
    Unmatched statement s1.add(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                          
    3
    s1.add(2.0, null);
    3
    s1.add(2.0, null);
    Preondition Violations
    Unmatched statement s1.add(2.0,null); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                            
    4
    s1.add(3.0, 3.3);
    4
    s1.add(3.0, 3.3);
    Preondition Violations
    Unmatched statement s1.add(3.0,3.3); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                          
    5
    XYSeriesCollection dataset = new XYSeriesCollection(s1);
    5
    XYSeriesCollection dataset = new XYSeriesCollection(s1);
    Preondition Violations
    Unmatched statement XYSeriesCollection dataset=new XYSeriesCollection(s1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                      
    6
    Range r = DatasetUtilities.iterateRangeBounds(dataset);
                                                                                                                    
    7
    assertEquals(1.1, r.getLowerBound(), EPSILON);
    7
    assertEquals(1.1, r.getLowerBound(), EPSILON);
    4
    assertTrue(i2.equals(i1));
    Differences
    Expression1Expression2Difference
    assertEqualsassertTrueMETHOD_INVOCATION_NAME_MISMATCH
    assertEquals(1.1,r.getLowerBound(),EPSILON)assertTrue(i2.equals(i1))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals(1.1,r.getLowerBound(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertTrue(i2.equals(i1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(1.1,r.getLowerBound(),EPSILON) is a void method call, and thus it cannot be parameterized
    Expression assertTrue(i2.equals(i1)) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(1.1,r.getLowerBound(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertTrue(i2.equals(i1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(1.1,r.getLowerBound(),EPSILON) is a void method call, and thus it cannot be parameterized
    Expression assertTrue(i2.equals(i1)) is a void method call, and thus it cannot be parameterized
    4
    assertTrue(i2.equals(i1));
    8
    assertEquals(3.3, r.getUpperBound(), EPSILON);
    8
    assertEquals(3.3, r.getUpperBound(), EPSILON);
    3
    assertTrue(i1.equals(i2));
    Differences
    Expression1Expression2Difference
    assertEqualsassertTrueMETHOD_INVOCATION_NAME_MISMATCH
    assertEquals(3.3,r.getUpperBound(),EPSILON)assertTrue(i1.equals(i2))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals(3.3,r.getUpperBound(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertTrue(i1.equals(i2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(3.3,r.getUpperBound(),EPSILON) is a void method call, and thus it cannot be parameterized
    Expression assertTrue(i1.equals(i2)) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(3.3,r.getUpperBound(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertTrue(i1.equals(i2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(3.3,r.getUpperBound(),EPSILON) is a void method call, and thus it cannot be parameterized
    Expression assertTrue(i1.equals(i2)) is a void method call, and thus it cannot be parameterized
    3
    assertTrue(i1.equals(i2));
                                                            
    5
    i1.setY(new Double(9.9));
    Preondition Violations
    Unmatched statement i1.setY(new Double(9.9)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    i1.setY(new Double(9.9));
                                                                
    6
    assertFalse(i1.equals(i2));
                                                            
    7
    i2.setY(new Double(9.9));
    Preondition Violations
    Unmatched statement i2.setY(new Double(9.9)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    i2.setY(new Double(9.9));
                                                              
    8
    assertTrue(i1.equals(i2));
    Precondition Violations (25)
    Row Violation
    1Unmatched statement XYDataItem i1=new XYDataItem(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement XYSeries s1=new XYSeries("S1"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement XYDataItem i2=new XYDataItem(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement s1.add(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement s1.add(2.0,null); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement s1.add(3.0,3.3); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched statement XYSeriesCollection dataset=new XYSeriesCollection(s1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Expression assertEquals(1.1,r.getLowerBound(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression assertTrue(i2.equals(i1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression assertEquals(1.1,r.getLowerBound(),EPSILON) is a void method call, and thus it cannot be parameterized
    11Expression assertTrue(i2.equals(i1)) is a void method call, and thus it cannot be parameterized
    12Expression assertEquals(1.1,r.getLowerBound(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression assertTrue(i2.equals(i1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression assertEquals(1.1,r.getLowerBound(),EPSILON) is a void method call, and thus it cannot be parameterized
    15Expression assertTrue(i2.equals(i1)) is a void method call, and thus it cannot be parameterized
    16Expression assertEquals(3.3,r.getUpperBound(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression assertTrue(i1.equals(i2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression assertEquals(3.3,r.getUpperBound(),EPSILON) is a void method call, and thus it cannot be parameterized
    19Expression assertTrue(i1.equals(i2)) is a void method call, and thus it cannot be parameterized
    20Expression assertEquals(3.3,r.getUpperBound(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression assertTrue(i1.equals(i2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression assertEquals(3.3,r.getUpperBound(),EPSILON) is a void method call, and thus it cannot be parameterized
    23Expression assertTrue(i1.equals(i2)) is a void method call, and thus it cannot be parameterized
    24Unmatched statement i1.setY(new Double(9.9)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    25Unmatched statement i2.setY(new Double(9.9)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted