Range r1 = new Range(0.1, 1000.0); assertEquals(r1.getLowerBound(), 0.1, 0.0d); assertEquals(r1.getUpperBound(), 1000.0, 0.0d); try { /*Range r2 =*/ new Range(10.0, 0.0); fail("Lower bound cannot be greater than the upper");
XYSeries s1 = new XYSeries("Series 1"); s1.add(1.0, 1.0); s1.add(2.0, 2.0); s1.add(3.0, 3.0); assertEquals(0, s1.indexOf(new Double(1.0)));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/junit/RangeTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYSeriesTests.java
Method name: void testConstructor() Method name: void testIndexOf()
Number of AST nodes: 5 Number of AST nodes: 5
1
Range r1 = new Range(0.1, 1000.0);
2
        assertEquals(r1.getLowerBound(), 0.1, 0
1
XYSeries s1 = new XYSeries("Series 1");
3
.0d);
2
        s1.add(1.0, 1.0);
4
        assertEquals(r1.getUpperBound(), 1000.0, 0.0d);
3
        s1.add(2.0, 2.0);
5
        try {
4
       
6
            /*Range r2 =*/ new Range(10.0, 0.0);
5
 s1.add(3.0, 3.0);
7
            fail("Lower bound cannot be greater than the upper");
6
        assertEquals(0, s1.indexOf(new Double(1.0)));
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 comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                    
    1
    XYSeries s1 = new XYSeries("Series 1");
    Preondition Violations
    Unmatched statement XYSeries s1=new XYSeries("Series 1"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    XYSeries s1 = new XYSeries("Series 1");
    1
    Range r1 = new Range(0.1, 1000.0);
    1
    Range r1 = new Range(0.1, 1000.0);
    Preondition Violations
    Unmatched statement Range r1=new Range(0.1,1000.0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                        
                                          
    2
    s1.add(1.0, 1.0);
    Preondition Violations
    Unmatched statement s1.add(1.0,1.0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    s1.add(1.0, 1.0);
                                          
    3
    s1.add(2.0, 2.0);
    Preondition Violations
    Unmatched statement s1.add(2.0,2.0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    s1.add(2.0, 2.0);
                                          
    4
    s1.add(3.0, 3.0);
    Preondition Violations
    Unmatched statement s1.add(3.0,3.0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    s1.add(3.0, 3.0);
    2
    assertEquals(r1.getLowerBound(), 0.1, 0.0d);
    2
    assertEquals(r1.getLowerBound(), 0.1, 0.0d);
    5
    assertEquals(0, s1.indexOf(new Double(1.0)));
    Differences
    Expression1Expression2Difference
    assertEquals(r1.getLowerBound(),0.1,0.0d)assertEquals(0,s1.indexOf(new Double(1.0)))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals(r1.getLowerBound(),0.1,0.0d) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(0,s1.indexOf(new Double(1.0))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(r1.getLowerBound(),0.1,0.0d) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(0,s1.indexOf(new Double(1.0))) is a void method call, and thus it cannot be parameterized
    5
    assertEquals(0, s1.indexOf(new Double(1.0)));
    3
    assertEquals(r1.getUpperBound(), 1000.0, 0.0d);
                                                                                                    
    Precondition Violations (9)
    Row Violation
    1Unmatched statement XYSeries s1=new XYSeries("Series 1"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement Range r1=new Range(0.1,1000.0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement s1.add(1.0,1.0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement s1.add(2.0,2.0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement s1.add(3.0,3.0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Expression assertEquals(r1.getLowerBound(),0.1,0.0d) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression assertEquals(0,s1.indexOf(new Double(1.0))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression assertEquals(r1.getLowerBound(),0.1,0.0d) is a void method call, and thus it cannot be parameterized
    9Expression assertEquals(0,s1.indexOf(new Double(1.0))) is a void method call, and thus it cannot be parameterized