if (this.backgroundDomainMarkers != null) { Set keys = this.backgroundDomainMarkers.keySet(); Iterator iterator = keys.iterator(); while (iterator.hasNext()) { Integer key = (Integer) iterator.next(); clearDomainMarkers(key.intValue()); } this.backgroundDomainMarkers.clear(); } if (this.foregroundDomainMarkers != null) { Set keys = this.foregroundDomainMarkers.keySet(); Iterator iterator = keys.iterator(); while (iterator.hasNext()) { Integer key = (Integer) iterator.next(); clearDomainMarkers(key.intValue()); } this.foregroundDomainMarkers.clear(); } fireChangeEvent();
if (this.backgroundRangeMarkers != null) { Set keys = this.backgroundRangeMarkers.keySet(); Iterator iterator = keys.iterator(); while (iterator.hasNext()) { Integer key = (Integer) iterator.next(); clearRangeMarkers(key.intValue()); } this.backgroundRangeMarkers.clear(); } if (this.foregroundRangeMarkers != null) { Set keys = this.foregroundRangeMarkers.keySet(); Iterator iterator = keys.iterator(); while (iterator.hasNext()) { Integer key = (Integer) iterator.next(); clearRangeMarkers(key.intValue()); } this.foregroundRangeMarkers.clear(); } fireChangeEvent();
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: void clearDomainMarkers() Method name: void clearRangeMarkers()
Number of AST nodes: 15 Number of AST nodes: 15
1
if (this.backgroundDomainMarkers != null) {
1
if (this.backgroundRangeMarkers != null) {
2
            Set keys = this.backgroundDomainMarkers.keySet();
2
            Set keys = this.backgroundRangeMarkers.keySet();
3
            Iterator iterator = keys.iterator();
3
            Iterator iterator = keys.iterator();
4
            while (iterator.hasNext()) {
4
            while (iterator.hasNext()) {
5
                Integer key = (Integer) iterator.next();
5
                Integer key = (Integer) iterator.next();
6
                clearDomainMarkers(key.intValue());
6
                clearRangeMarkers(key.intValue());
7
            }
7
            }
8
            this.backgroundDomainMarkers.clear();
8
            this.backgroundRangeMarkers.clear();
9
        }
9
        }
10
        if (this.foregroundDomainMarkers != null) {
10
        if (this.foregroundRangeMarkers != null) {
11
            Set keys = this.foregroundDomainMarkers.keySet();
11
            Set keys = this.foregroundRangeMarkers.keySet();
12
            Iterator iterator = keys.iterator();
12
            Iterator iterator = keys.iterator();
13
            while (iterator.hasNext()) {
13
            while (iterator.hasNext()) {
14
                Integer key = (Integer) iterator.next();
14
                Integer key = (Integer) iterator.next();
15
                clearDomainMarkers(key.intValue());
15
                clearRangeMarkers(key.intValue());
16
            }
16
            }
17
            this.foregroundDomainMarkers.clear();
17
            this.foregroundRangeMarkers.clear();
18
        }
18
        }
19
        fireChangeEvent();
19
        fireChangeEvent();
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.8
Clones locationClones are declared in the same class
Number of node comparisons63
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)101.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this.backgroundDomainMarkers != null)
    1
    if (this.backgroundDomainMarkers != null)
    1
    if (this.backgroundRangeMarkers != null)
    Differences
    Expression1Expression2Difference
    backgroundDomainMarkersbackgroundRangeMarkersVARIABLE_NAME_MISMATCH
    1
    if (this.backgroundRangeMarkers != null)
    2
    Set keys = this.backgroundDomainMarkers.keySet();
    2
    Set keys = this.backgroundDomainMarkers.keySet();
    2
    Set keys = this.backgroundRangeMarkers.keySet();
    Differences
    Expression1Expression2Difference
    backgroundDomainMarkersbackgroundRangeMarkersVARIABLE_NAME_MISMATCH
    2
    Set keys = this.backgroundRangeMarkers.keySet();
    3
    Iterator iterator = keys.iterator();
    3
    Iterator iterator = keys.iterator();
    4
    while (iterator.hasNext())
    4
    while (iterator.hasNext())
    5
    Integer key = (Integer)iterator.next();
    5
    Integer key = (Integer)iterator.next();
    6
    clearDomainMarkers(key.intValue());
    6
    clearDomainMarkers(key.intValue());
    6
    clearRangeMarkers(key.intValue());
    Differences
    Expression1Expression2Difference
    clearDomainMarkersclearRangeMarkersMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression clearDomainMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clearRangeMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clearDomainMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    Expression clearRangeMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    6
    clearRangeMarkers(key.intValue());
    7
    this.backgroundDomainMarkers.clear();
    7
    this.backgroundDomainMarkers.clear();
    7
    this.backgroundRangeMarkers.clear();
    Differences
    Expression1Expression2Difference
    backgroundDomainMarkersbackgroundRangeMarkersVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.backgroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.backgroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    this.backgroundRangeMarkers.clear();
    8
    if (this.foregroundDomainMarkers != null)
    8
    if (this.foregroundDomainMarkers != null)
    8
    if (this.foregroundRangeMarkers != null)
    Differences
    Expression1Expression2Difference
    foregroundDomainMarkersforegroundRangeMarkersVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (this.foregroundRangeMarkers != null)
    9
    Set keys = this.foregroundDomainMarkers.keySet();
    9
    Set keys = this.foregroundDomainMarkers.keySet();
    9
    Set keys = this.foregroundRangeMarkers.keySet();
    Differences
    Expression1Expression2Difference
    foregroundDomainMarkersforegroundRangeMarkersVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    Set keys = this.foregroundRangeMarkers.keySet();
    10
    Iterator iterator = keys.iterator();
    10
    Iterator iterator = keys.iterator();
    11
    while (iterator.hasNext())
    11
    while (iterator.hasNext())
    12
    Integer key = (Integer)iterator.next();
    12
    Integer key = (Integer)iterator.next();
    13
    clearDomainMarkers(key.intValue());
    13
    clearDomainMarkers(key.intValue());
    13
    clearRangeMarkers(key.intValue());
    Differences
    Expression1Expression2Difference
    clearDomainMarkersclearRangeMarkersMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression clearDomainMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clearRangeMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clearDomainMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    Expression clearRangeMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    13
    clearRangeMarkers(key.intValue());
    14
    this.foregroundDomainMarkers.clear();
    14
    this.foregroundDomainMarkers.clear();
    14
    this.foregroundRangeMarkers.clear();
    Differences
    Expression1Expression2Difference
    foregroundDomainMarkersforegroundRangeMarkersVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    this.foregroundRangeMarkers.clear();
    15
    fireChangeEvent();
    15
    fireChangeEvent();
    Precondition Violations (16)
    Row Violation
    1Expression clearDomainMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression clearRangeMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression clearDomainMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    4Expression clearRangeMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    5Expression this.backgroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression this.backgroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression clearDomainMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression clearRangeMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression clearDomainMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    14Expression clearRangeMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    15Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted