if (position != -1) { this.subplots.remove(position); subplot.setParent(null); subplot.removeChangeListener(this); this.totalWeight -= subplot.getWeight(); CategoryAxis domain = getDomainAxis(); if (domain != null) { domain.configure(); } fireChangeEvent(); }
if (position != -1) { this.subplots.remove(position); subplot.setParent(null); subplot.removeChangeListener(this); this.totalWeight -= subplot.getWeight(); ValueAxis domain = getDomainAxis(); if (domain != null) { domain.configure(); } fireChangeEvent(); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainCategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java
Method name: void remove(CategoryPlot) Method name: void remove(XYPlot)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (position != -1) {
1
if (position != -1) {
2
            this.subplots.remove(position);
2
            this.subplots.remove(position);
3
            subplot.setParent(null);
3
            subplot.setParent(null);
4
            subplot.removeChangeListener(this);
4
            subplot.removeChangeListener(this);
5
            this.totalWeight -= subplot.getWeight();
5
            this.totalWeight -= subplot.getWeight();
6
            CategoryAxis domain = getDomainAxis();
6
            ValueAxis domain = getDomainAxis();
7
            if (domain != null) {
7
            if (domain != null) {
8
                domain.configure();
8
                domain.configure();
9
            }
9
            }
10
            fireChangeEvent();
10
            fireChangeEvent();
11
        }
11
        }
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons54
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    if (position != -1)
    10
    if (position != -1)
    11
    this.subplots.remove(position);
    11
    this.subplots.remove(position);
    12
    subplot.setParent(null);
    12
    subplot.setParent(null);
    12
    subplot.setParent(null);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    12
    subplot.setParent(null);
    13
    subplot.removeChangeListener(this);
    13
    subplot.removeChangeListener(this);
    13
    subplot.removeChangeListener(this);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    13
    subplot.removeChangeListener(this);
    14
    this.totalWeight -= subplot.getWeight();
    14
    this.totalWeight -= subplot.getWeight();
    14
    this.totalWeight -= subplot.getWeight();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression subplot cannot be unified with expression subplot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight()
    14
    this.totalWeight -= subplot.getWeight();
    15
    CategoryAxis domain = getDomainAxis();
    15
    CategoryAxis domain = getDomainAxis();
    15
    ValueAxis domain = getDomainAxis();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    15
    ValueAxis domain = getDomainAxis();
    16
    if (domain != null)
    16
    if (domain != null)
    16
    if (domain != null)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    16
    if (domain != null)
    17
    domain.configure();
    17
    domain.configure();
    17
    domain.configure();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    17
    domain.configure();
    18
    fireChangeEvent();
    18
    fireChangeEvent();
    Precondition Violations (1)
    Row Violation
    1Expression subplot cannot be unified with expression subplot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight()