if (subplot == null) { throw new IllegalArgumentException("Null 'subplot' argument."); } if (weight < 1) { throw new IllegalArgumentException("Require weight >= 1."); } subplot.setParent(this); subplot.setWeight(weight); subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); subplot.setDomainAxis(null); subplot.setOrientation(getOrientation()); subplot.addChangeListener(this); this.subplots.add(subplot); this.totalWeight += weight; CategoryAxis axis = getDomainAxis(); if (axis != null) { axis.configure(); } fireChangeEvent();
if (subplot == null) { throw new IllegalArgumentException("Null 'subplot' argument."); } if (weight <= 0) { throw new IllegalArgumentException("Require weight >= 1."); } // store the plot and its weight subplot.setParent(this); subplot.setWeight(weight); subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0), false); subplot.setDomainAxis(null); subplot.addChangeListener(this); this.subplots.add(subplot); // keep track of total weights this.totalWeight += weight; ValueAxis axis = getDomainAxis(); if (axis != null) { axis.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 add(CategoryPlot, int) Method name: void add(XYPlot, int)
Number of AST nodes: 16 Number of AST nodes: 15
1
if (subplot == null) {
1
if (subplot == null) {
2
            throw new IllegalArgumentException("Null 'subplot' argument.");
2
            throw new IllegalArgumentException("Null 'subplot' argument.");
3
        }
3
        }
4
        if (weight < 1) {
4
        if (weight <= 0) {
5
            throw new IllegalArgumentException("Require weight >= 1.");
5
            throw new IllegalArgumentException("Require weight >= 1.");
6
        }
6
        }
7
        // store the plot and its weight
7
        subplot.setParent(this);
8
        subplot.setParent(this);
8
        subplot.setWeight(weight);
9
        subplot.setWeight(weight);
9
        subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
10
        subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0), false);
10
        subplot.setDomainAxis(null);
11
        subplot.setDomainAxis(null);
11
        subplot.setOrientation(getOrientation());
12
        subplot.addChangeListener(this);
12
        subplot.addChangeListener(this);
13
        this.subplots.add(subplot);
13
        this.subplots.add(subplot);
14
        // keep track of total weights
14
        this.totalWeight += weight;
15
        this.totalWeight += weight;
15
        CategoryAxis axis = getDomainAxis();
16
        ValueAxis axis = getDomainAxis();
16
        if (axis != null) {
17
        if (axis != null) {
17
            axis.configure();
18
            axis.configure();
18
        }
19
        }
19
        fireChangeEvent();
20
        fireChangeEvent();
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)1.2
Clones locationClones are in different classes having the same super class
Number of node comparisons72
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)144.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (subplot == null)
    1
    if (subplot == null)
    1
    if (subplot == null)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    1
    if (subplot == null)
    2
    throw new IllegalArgumentException("Null 'subplot' argument.");
    2
    throw new IllegalArgumentException("Null 'subplot' argument.");
                                        
    3
    if (weight <= 0)
                                                                                                                                
    4
    throw new IllegalArgumentException("Require weight >= 1.");
    Preondition Violations
    Unmatched throw new IllegalArgumentException("Require weight >= 1.");
    4
    throw new IllegalArgumentException("Require weight >= 1.");
    3
    if (weight < 1)
                                      
    4
    throw new IllegalArgumentException("Require weight >= 1.");
    4
    throw new IllegalArgumentException("Require weight >= 1.");
    Preondition Violations
    Unmatched throw new IllegalArgumentException("Require weight >= 1.");
                                                                                                                                
    5
    subplot.setParent(this);
    5
    subplot.setParent(this);
    5
    subplot.setParent(this);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    5
    subplot.setParent(this);
    6
    subplot.setWeight(weight);
    6
    subplot.setWeight(weight);
    6
    subplot.setWeight(weight);
    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 void setWeight(int)
    6
    subplot.setWeight(weight);
    7
    subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
    7
    subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
    7
    subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0), false);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0))subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0),false)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0),false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0)) is a void method call, and thus it cannot be parameterized
    Expression subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0),false) is a void method call, and thus it cannot be parameterized
    7
    subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0), false);
    8
    subplot.setDomainAxis(null);
    8
    subplot.setDomainAxis(null);
    8
    subplot.setDomainAxis(null);
    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 void setDomainAxis(org.jfree.chart.axis.CategoryAxis) , public void setDomainAxis(org.jfree.chart.axis.ValueAxis)
    8
    subplot.setDomainAxis(null);
    9
    subplot.setOrientation(getOrientation());
    9
    subplot.setOrientation(getOrientation());
    Preondition Violations
    Unmatched statement subplot.setOrientation(getOrientation()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                            
    10
    subplot.addChangeListener(this);
    10
    subplot.addChangeListener(this);
    9
    subplot.addChangeListener(this);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    9
    subplot.addChangeListener(this);
    11
    this.subplots.add(subplot);
    11
    this.subplots.add(subplot);
    10
    this.subplots.add(subplot);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    10
    this.subplots.add(subplot);
    12
    this.totalWeight += weight;
    11
    this.totalWeight += weight;
    13
    CategoryAxis axis = getDomainAxis();
    13
    CategoryAxis axis = getDomainAxis();
    12
    ValueAxis axis = 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
    12
    ValueAxis axis = getDomainAxis();
    14
    if (axis != null)
    14
    if (axis != null)
    13
    if (axis != null)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    13
    if (axis != null)
    15
    axis.configure();
    15
    axis.configure();
    14
    axis.configure();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    14
    axis.configure();
    Precondition Violations (9)
    Row Violation
    1Unmatched throw new IllegalArgumentException("Require weight >= 1.");
    2Unmatched throw new IllegalArgumentException("Require weight >= 1.");
    3Expression subplot cannot be unified with expression subplot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public void setWeight(int)
    4Expression subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0),false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0)) is a void method call, and thus it cannot be parameterized
    7Expression subplot.setInsets(new RectangleInsets(0.0,0.0,0.0,0.0),false) is a void method call, and thus it cannot be parameterized
    8Expression subplot cannot be unified with expression subplot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public void setDomainAxis(org.jfree.chart.axis.CategoryAxis) , public void setDomainAxis(org.jfree.chart.axis.ValueAxis)
    9Unmatched statement subplot.setOrientation(getOrientation()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted