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();
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();
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: void clearRangeMarkers() Method name: void clearDomainMarkers()
Number of AST nodes: 15 Number of AST nodes: 15
1
if (this.backgroundRangeMarkers != null) {
1
if (this.backgroundDomainMarkers != null) {
2
            Set keys = this.backgroundRangeMarkers.keySet();
2
            Set keys = this.backgroundDomainMarkers.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
                clearRangeMarkers(key.intValue());
6
                clearDomainMarkers(key.intValue());
7
            }
7
            }
8
            this.backgroundRangeMarkers.clear();
8
            this.backgroundDomainMarkers.clear();
9
        }
9
        }
10
        if (this.foregroundRangeMarkers != null) {
10
        if (this.foregroundDomainMarkers != null) {
11
            Set keys = this.foregroundRangeMarkers.keySet();
11
            Set keys = this.foregroundDomainMarkers.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
                clearRangeMarkers(key.intValue());
15
                clearDomainMarkers(key.intValue());
16
            }
16
            }
17
            this.foregroundRangeMarkers.clear();
17
            this.foregroundDomainMarkers.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)2.0
Clones locationClones are in different classes having the same super 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)107.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this.backgroundRangeMarkers != null)
    1
    if (this.backgroundRangeMarkers != null)
    1
    if (this.backgroundDomainMarkers != null)
    Differences
    Expression1Expression2Difference
    backgroundRangeMarkersbackgroundDomainMarkersVARIABLE_NAME_MISMATCH
    1
    if (this.backgroundDomainMarkers != null)
    2
    Set keys = this.backgroundRangeMarkers.keySet();
    2
    Set keys = this.backgroundRangeMarkers.keySet();
    2
    Set keys = this.backgroundDomainMarkers.keySet();
    Differences
    Expression1Expression2Difference
    backgroundRangeMarkersbackgroundDomainMarkersVARIABLE_NAME_MISMATCH
    2
    Set keys = this.backgroundDomainMarkers.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
    clearRangeMarkers(key.intValue());
    6
    clearRangeMarkers(key.intValue());
    6
    clearDomainMarkers(key.intValue());
    Differences
    Expression1Expression2Difference
    clearRangeMarkersclearDomainMarkersMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression clearRangeMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clearDomainMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clearRangeMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    Expression clearDomainMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    6
    clearDomainMarkers(key.intValue());
    7
    this.backgroundRangeMarkers.clear();
    7
    this.backgroundRangeMarkers.clear();
    7
    this.backgroundDomainMarkers.clear();
    Differences
    Expression1Expression2Difference
    backgroundRangeMarkersbackgroundDomainMarkersVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.backgroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.backgroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    this.backgroundDomainMarkers.clear();
    8
    if (this.foregroundRangeMarkers != null)
    8
    if (this.foregroundRangeMarkers != null)
    8
    if (this.foregroundDomainMarkers != null)
    Differences
    Expression1Expression2Difference
    foregroundRangeMarkersforegroundDomainMarkersVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (this.foregroundDomainMarkers != null)
    9
    Set keys = this.foregroundRangeMarkers.keySet();
    9
    Set keys = this.foregroundRangeMarkers.keySet();
    9
    Set keys = this.foregroundDomainMarkers.keySet();
    Differences
    Expression1Expression2Difference
    foregroundRangeMarkersforegroundDomainMarkersVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    Set keys = this.foregroundDomainMarkers.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
    clearRangeMarkers(key.intValue());
    13
    clearRangeMarkers(key.intValue());
    13
    clearDomainMarkers(key.intValue());
    Differences
    Expression1Expression2Difference
    clearRangeMarkersclearDomainMarkersMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression clearRangeMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clearDomainMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clearRangeMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    Expression clearDomainMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    13
    clearDomainMarkers(key.intValue());
    14
    this.foregroundRangeMarkers.clear();
    14
    this.foregroundRangeMarkers.clear();
    14
    this.foregroundDomainMarkers.clear();
    Differences
    Expression1Expression2Difference
    foregroundRangeMarkersforegroundDomainMarkersVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    this.foregroundDomainMarkers.clear();
    15
    fireChangeEvent();
    15
    fireChangeEvent();
    Precondition Violations (16)
    Row Violation
    1Expression clearRangeMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression clearDomainMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression clearRangeMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    4Expression clearDomainMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    5Expression this.backgroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression this.backgroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression clearRangeMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression clearDomainMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression clearRangeMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    14Expression clearDomainMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
    15Expression this.foregroundRangeMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression this.foregroundDomainMarkers cannot be parameterized, because it has dependencies to/from statements that will be extracted