330-1-2

if (this.dataset != null) { this.dataset.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self to trigger plot change event datasetChanged(new DatasetChangeEvent(this, dataset));
if (this.dataset != null) { this.dataset.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self to trigger plot change event datasetChanged(new DatasetChangeEvent(this, dataset));

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/WaferMapPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java
Method name: `void setDataset(WaferMapDataset)` |  | Method name: `void setDataset(CategoryDataset)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    if (this.dataset != null) {↵

1

    if (this.dataset != null) {↵

2

                this.dataset.removeChangeListener(this);↵

2

                this.dataset.removeChangeListener(this);↵

3

            }↵

3

            }↵

4

            // set the new dataset, and register the chart as a change listener...↵

4

            // set the new dataset, and register the chart as a change listener...↵

5

            this.dataset = dataset;↵

5

            this.dataset = dataset;↵

6

            if (dataset != null) {↵

6

            if (dataset != null) {↵

7

                setDatasetGroup(dataset.getGroup());↵

7

                setDatasetGroup(dataset.getGroup());↵

8

                dataset.addChangeListener(this);↵

8

                dataset.addChangeListener(this);↵

9

            }↵

9

            }↵

10

            // send a dataset change event to self to trigger plot change event↵

10

            // send a dataset change event to self to trigger plot change event↵

11

            datasetChanged(new DatasetChangeEvent(this, dataset));

11

            datasetChanged(new DatasetChangeEvent(this, dataset));

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.3
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 24

1. {Non-refactorable}

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

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

   1

       if (this.dataset != null)

   1 | if (this.dataset != null)
   1 | if (this.dataset != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.general.WaferMapDataset | org.jfree.data.category.CategoryDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.general.WaferMapDataset of variable this.dataset does not match with type org.jfree.data.category.CategoryDataset of variable this.dataset
   - Make classes org.jfree.data.general.WaferMapDataset and org.jfree.data.category.CategoryDataset extend a common superclass

   1

       if (this.dataset != null)

   2

       this.dataset.removeChangeListener(this);

   2 | this.dataset.removeChangeListener(this);
   2 | this.dataset.removeChangeListener(this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.general.WaferMapDataset | org.jfree.data.category.CategoryDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.general.WaferMapDataset of variable this.dataset does not match with type org.jfree.data.category.CategoryDataset of variable this.dataset
   - Make classes org.jfree.data.general.WaferMapDataset and org.jfree.data.category.CategoryDataset extend a common superclass

   2

       this.dataset.removeChangeListener(this);

   3

       this.dataset = dataset;

   3

       this.dataset = dataset;

   4

       if (dataset != null)

   4 | if (dataset != null)
   4 | if (dataset != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.general.WaferMapDataset | org.jfree.data.category.CategoryDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.general.WaferMapDataset of variable dataset does not match with type org.jfree.data.category.CategoryDataset of variable dataset
   - Make classes org.jfree.data.general.WaferMapDataset and org.jfree.data.category.CategoryDataset extend a common superclass

   4

       if (dataset != null)

   5

       setDatasetGroup(dataset.getGroup());

   5 | setDatasetGroup(dataset.getGroup());
   5 | setDatasetGroup(dataset.getGroup());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.general.WaferMapDataset | org.jfree.data.category.CategoryDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.general.WaferMapDataset of variable dataset does not match with type org.jfree.data.category.CategoryDataset of variable dataset
   - Make classes org.jfree.data.general.WaferMapDataset and org.jfree.data.category.CategoryDataset extend a common superclass

   5

       setDatasetGroup(dataset.getGroup());

   6

       dataset.addChangeListener(this);

   6 | dataset.addChangeListener(this);
   6 | dataset.addChangeListener(this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.general.WaferMapDataset | org.jfree.data.category.CategoryDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.general.WaferMapDataset of variable dataset does not match with type org.jfree.data.category.CategoryDataset of variable dataset
   - Make classes org.jfree.data.general.WaferMapDataset and org.jfree.data.category.CategoryDataset extend a common superclass

   6

       dataset.addChangeListener(this);

   7

       datasetChanged(new DatasetChangeEvent(this, dataset));

   7 | datasetChanged(new DatasetChangeEvent(this, dataset));
   7 | datasetChanged(new DatasetChangeEvent(this, dataset));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.general.WaferMapDataset | org.jfree.data.category.CategoryDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.general.WaferMapDataset of variable dataset does not match with type org.jfree.data.category.CategoryDataset of variable dataset
   - Make classes org.jfree.data.general.WaferMapDataset and org.jfree.data.category.CategoryDataset extend a common superclass

   7

       datasetChanged(new DatasetChangeEvent(this, dataset));

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Type org.jfree.data.general.WaferMapDataset of variable this.dataset does not match with type org.jfree.data.category.CategoryDataset of variable this.dataset
   2 | Type org.jfree.data.general.WaferMapDataset of variable this.dataset does not match with type org.jfree.data.category.CategoryDataset of variable this.dataset
   3 | Type org.jfree.data.general.WaferMapDataset of variable dataset does not match with type org.jfree.data.category.CategoryDataset of variable dataset
   4 | Type org.jfree.data.general.WaferMapDataset of variable dataset does not match with type org.jfree.data.category.CategoryDataset of variable dataset
   5 | Type org.jfree.data.general.WaferMapDataset of variable dataset does not match with type org.jfree.data.category.CategoryDataset of variable dataset
   6 | Type org.jfree.data.general.WaferMapDataset of variable dataset does not match with type org.jfree.data.category.CategoryDataset of variable dataset