ValueMarker m = new ValueMarker(1.1); m.addChangeListener(this); this.lastEvent = null; assertEquals(0.8f, m.getAlpha(), EPSILON); m.setAlpha(0.5f); assertEquals(0.5f, m.getAlpha(), EPSILON); assertEquals(m, this.lastEvent.getMarker());
ValueMarker m = new ValueMarker(1.1); m.addChangeListener(this); this.lastEvent = null; assertEquals(1.1, m.getValue(), EPSILON); m.setValue(33.3); assertEquals(33.3, m.getValue(), EPSILON); assertEquals(m, this.lastEvent.getMarker());
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/MarkerTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/ValueMarkerTests.java
Method name: void testGetSetAlpha() Method name: void testGetSetValue()
Number of AST nodes: 7 Number of AST nodes: 7
1
ValueMarker m = new ValueMarker(1.1);
1
ValueMarker m = new ValueMarker(1.1);
2
        m.addChangeListener(this);
2
        m.addChangeListener(this);
3
        this.lastEvent = null;
3
        this.lastEvent = null;
4
        assertEquals(0.8f, m.getAlpha(), EPSILON);
4
        assertEquals(1.1, m.getValue(), EPSILON);
5
        m.setAlpha(0.5f);
5
        m.setValue(33.3);
6
        assertEquals(0.5f, m.getAlpha(), EPSILON);
6
        assertEquals(33.3, m.getValue(), EPSILON);
7
        assertEquals(m, this.lastEvent.getMarker());
7
        assertEquals(m, this.lastEvent.getMarker());
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 comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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
    ValueMarker m = new ValueMarker(1.1);
    1
    ValueMarker m = new ValueMarker(1.1);
    2
    m.addChangeListener(this);
    2
    m.addChangeListener(this);
    3
    this.lastEvent = null;
    3
    this.lastEvent = null;
    4
    assertEquals(0.8f, m.getAlpha(), EPSILON);
    4
    assertEquals(0.8f, m.getAlpha(), EPSILON);
    4
    assertEquals(1.1, m.getValue(), EPSILON);
    Differences
    Expression1Expression2Difference
    0.8f1.1LITERAL_VALUE_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    getAlphagetValueMETHOD_INVOCATION_NAME_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type float of variable 0.8f does not match with type double of variable 1.1
    Expression m.getAlpha() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression m.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type float of variable m.getAlpha() does not match with type double of variable m.getValue()
    Type float of variable EPSILON does not match with type double of variable EPSILON
    4
    assertEquals(1.1, m.getValue(), EPSILON);
    5
    m.setAlpha(0.5f);
    5
    m.setAlpha(0.5f);
    5
    m.setValue(33.3);
    Differences
    Expression1Expression2Difference
    0.5f33.3LITERAL_VALUE_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    setAlphasetValueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Type float of variable 0.5f does not match with type double of variable 33.3
    Expression m.setAlpha(0.5f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression m.setValue(33.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression m.setAlpha(0.5f) is a void method call, and thus it cannot be parameterized
    Expression m.setValue(33.3) is a void method call, and thus it cannot be parameterized
    5
    m.setValue(33.3);
    6
    assertEquals(0.5f, m.getAlpha(), EPSILON);
    6
    assertEquals(0.5f, m.getAlpha(), EPSILON);
    6
    assertEquals(33.3, m.getValue(), EPSILON);
    Differences
    Expression1Expression2Difference
    0.5f33.3LITERAL_VALUE_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    getAlphagetValueMETHOD_INVOCATION_NAME_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type float of variable 0.5f does not match with type double of variable 33.3
    Expression m.getAlpha() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression m.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type float of variable m.getAlpha() does not match with type double of variable m.getValue()
    Type float of variable EPSILON does not match with type double of variable EPSILON
    6
    assertEquals(33.3, m.getValue(), EPSILON);
    7
    assertEquals(m, this.lastEvent.getMarker());
    7
    assertEquals(m, this.lastEvent.getMarker());
    Precondition Violations (15)
    Row Violation
    1Type float of variable 0.8f does not match with type double of variable 1.1
    2Expression m.getAlpha() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression m.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type float of variable m.getAlpha() does not match with type double of variable m.getValue()
    5Type float of variable EPSILON does not match with type double of variable EPSILON
    6Type float of variable 0.5f does not match with type double of variable 33.3
    7Expression m.setAlpha(0.5f) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression m.setValue(33.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression m.setAlpha(0.5f) is a void method call, and thus it cannot be parameterized
    10Expression m.setValue(33.3) is a void method call, and thus it cannot be parameterized
    11Type float of variable 0.5f does not match with type double of variable 33.3
    12Expression m.getAlpha() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression m.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type float of variable m.getAlpha() does not match with type double of variable m.getValue()
    15Type float of variable EPSILON does not match with type double of variable EPSILON