1409-5-8

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.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(); }

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: 7 |  | Number of AST nodes: 7

1

    if (this.backgroundDomainMarkers != null) {↵

1

    if (this.foregroundRangeMarkers != null) {↵

2

                Set keys = this.backgroundDomainMarkers.keySet();↵

2

                Set keys = this.foregroundRangeMarkers.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.foregroundRangeMarkers.clear();↵

9

            }

9

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2
Clones location | Clones are declared in the same class
Number of node comparisons | 25

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 12.2
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       if (this.backgroundDomainMarkers != null)

   1 | if (this.backgroundDomainMarkers != null)
   8 | if (this.foregroundRangeMarkers != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   backgroundDomainMarkers | foregroundRangeMarkers | VARIABLE_NAME_MISMATCH

   8

       if (this.foregroundRangeMarkers != null)

   2

       Set keys = this.backgroundDomainMarkers.keySet();

   2 | Set keys = this.backgroundDomainMarkers.keySet();
   9 | Set keys = this.foregroundRangeMarkers.keySet();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   backgroundDomainMarkers | foregroundRangeMarkers | VARIABLE_NAME_MISMATCH

   9

       Set keys = this.foregroundRangeMarkers.keySet();

   3

       Iterator iterator = keys.iterator();

   10

       Iterator iterator = keys.iterator();

   4

       while (iterator.hasNext())

   11

       while (iterator.hasNext())

   5

       Integer key = (Integer)iterator.next();

   12

       Integer key = (Integer)iterator.next();

   6

       clearDomainMarkers(key.intValue());

   6 | clearDomainMarkers(key.intValue());
   13 | clearRangeMarkers(key.intValue());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   clearDomainMarkers | clearRangeMarkers | METHOD_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());

   7

       this.backgroundDomainMarkers.clear();

   7 | this.backgroundDomainMarkers.clear();
   14 | this.foregroundRangeMarkers.clear();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   backgroundDomainMarkers | foregroundRangeMarkers | VARIABLE_NAME_MISMATCH

   14

       this.foregroundRangeMarkers.clear();

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Expression clearDomainMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression clearRangeMarkers(key.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression clearDomainMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized
   4 | Expression clearRangeMarkers(key.intValue()) is a void method call, and thus it cannot be parameterized