LineGraph panel = new LineGraph(); panel.setTitle(this.getTitle()); panel.setData(data); panel.setXAxisLabels(xAxisLabels); panel.setYAxisLabels(this.getURLs().split(URL_DELIM)); panel.setXAxisTitle(this.getFormattedXAxis()); panel.setYAxisTitle(this.getYAxis()); // we should make this configurable eventually int _width = getWidth(); int _height = getHeight(); panel.setPreferredSize(new Dimension(_width,_height)); panel.setSize(new Dimension(_width,_height)); panel.setWidth(_width); panel.setHeight(_width); setBufferedImage(new BufferedImage(_width,_height,BufferedImage.TYPE_INT_RGB)); panel.paintComponent(this.getBufferedImage().createGraphics()); return panel;
AxisGraph panel = new AxisGraph(); panel.setTitle(this.getTitle()); panel.setData(data); panel.setXAxisLabels(xAxisLabels); panel.setYAxisLabels(this.getYLabel()); panel.setXAxisTitle(this.getFormattedXAxis()); panel.setYAxisTitle(this.getYAxis()); // we should make this configurable eventually int width = getWidth(); int height = getHeight(); panel.setPreferredSize(new Dimension(width,height)); panel.setSize(new Dimension(width,height)); panel.setWidth(width); panel.setHeight(width); setBufferedImage(new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB)); panel.paintComponent(this.getBufferedImage().createGraphics()); return panel;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/LineChart.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/BarChart.java
Method name: JComponent renderGraphics(double[][], String[]) Method name: JComponent renderGraphics(double[][], String[])
Number of AST nodes: 16 Number of AST nodes: 16
1
LineGraph panel = new LineGraph();
1
AxisGraph panel = new AxisGraph();
2
        panel.setTitle(this.getTitle());
2
        panel.setTitle(this.getTitle());
3
        panel.setData(data);
3
        panel.setData(data);
4
        panel.setXAxisLabels(xAxisLabels);
4
        panel.setXAxisLabels(xAxisLabels);
5
        panel.setYAxisLabels(this.getURLs().split(URL_DELIM));
5
        panel.setYAxisLabels(this.getYLabel());
6
        panel.setXAxisTitle(this.getFormattedXAxis());
6
        panel.setXAxisTitle(this.getFormattedXAxis());
7
        panel.setYAxisTitle(this.getYAxis());
7
        panel.setYAxisTitle(this.getYAxis());
8
        // we should make this configurable eventually
8
        // we should make this configurable eventually
9
        int _width = getWidth();
9
        int width = getWidth();
10
        int _height = getHeight();
10
        int height = getHeight();
11
        panel.setPreferredSize(new Dimension(_width,_height));
11
        panel.setPreferredSize(new Dimension(width,height));
12
        panel.setSize(new Dimension(_width,_height));
12
        panel.setSize(new Dimension(width,height));
13
        panel.setWidth(_width);
13
        panel.setWidth(width);
14
        panel.setHeight(_width);
14
        panel.setHeight(width);
15
        setBufferedImage(new BufferedImage(_width,_height,BufferedImage.TYPE_INT_RGB));
15
        setBufferedImage(new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB));
16
        panel.paintComponent(this.getBufferedImage().createGraphics());
16
        panel.paintComponent(this.getBufferedImage().createGraphics());
17
        return panel;
17
        return panel;
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons157
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    LineGraph panel = new LineGraph();
    1
    LineGraph panel = new LineGraph();
    1
    AxisGraph panel = new AxisGraph();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    1
    AxisGraph panel = new AxisGraph();
    2
    panel.setTitle(this.getTitle());
    2
    panel.setTitle(this.getTitle());
    2
    panel.setTitle(this.getTitle());
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setTitle(java.lang.String)
    2
    panel.setTitle(this.getTitle());
    3
    panel.setData(data);
    3
    panel.setData(data);
    3
    panel.setData(data);
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setData(double[][])
    3
    panel.setData(data);
    4
    panel.setXAxisLabels(xAxisLabels);
    4
    panel.setXAxisLabels(xAxisLabels);
    4
    panel.setXAxisLabels(xAxisLabels);
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setXAxisLabels(java.lang.String[])
    4
    panel.setXAxisLabels(xAxisLabels);
    5
    panel.setYAxisLabels(this.getURLs().split(URL_DELIM));
    5
    panel.setYAxisLabels(this.getURLs().split(URL_DELIM));
    Preondition Violations
    Unmatched statement panel.setYAxisLabels(this.getURLs().split(URL_DELIM)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                      
    6
    panel.setXAxisTitle(this.getFormattedXAxis());
    6
    panel.setXAxisTitle(this.getFormattedXAxis());
    6
    panel.setXAxisTitle(this.getFormattedXAxis());
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setXAxisTitle(java.lang.String)
    6
    panel.setXAxisTitle(this.getFormattedXAxis());
    7
    panel.setYAxisTitle(this.getYAxis());
    7
    panel.setYAxisTitle(this.getYAxis());
    5
    panel.setYAxisLabels(this.getYLabel());
    Differences
    Expression1Expression2Difference
    setYAxisTitlesetYAxisLabelsMETHOD_INVOCATION_NAME_MISMATCH
    getYAxisgetYLabelMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression panel.setYAxisTitle(this.getYAxis()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.setYAxisLabels(this.getYLabel()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.setYAxisTitle(this.getYAxis()) is a void method call, and thus it cannot be parameterized
    Expression panel.setYAxisLabels(this.getYLabel()) is a void method call, and thus it cannot be parameterized
    5
    panel.setYAxisLabels(this.getYLabel());
                                                                                    
    7
    panel.setYAxisTitle(this.getYAxis());
    Preondition Violations
    Unmatched statement panel.setYAxisTitle(this.getYAxis()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    panel.setYAxisTitle(this.getYAxis());
    8
    int _width = getWidth();
    8
    int _width = getWidth();
    8
    int width = getWidth();
    Differences
    Expression1Expression2Difference
    _widthwidthVARIABLE_NAME_MISMATCH
    8
    int width = getWidth();
    9
    int _height = getHeight();
    9
    int _height = getHeight();
    9
    int height = getHeight();
    Differences
    Expression1Expression2Difference
    _heightheightVARIABLE_NAME_MISMATCH
    9
    int height = getHeight();
    10
    panel.setPreferredSize(new Dimension(_width, _height));
    10
    panel.setPreferredSize(new Dimension(_width, _height));
    10
    panel.setPreferredSize(new Dimension(width, height));
    Differences
    Expression1Expression2Difference
    _widthwidthVARIABLE_NAME_MISMATCH
    _heightheightVARIABLE_NAME_MISMATCH
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    10
    panel.setPreferredSize(new Dimension(width, height));
    11
    panel.setSize(new Dimension(_width, _height));
    11
    panel.setSize(new Dimension(_width, _height));
    11
    panel.setSize(new Dimension(width, height));
    Differences
    Expression1Expression2Difference
    _widthwidthVARIABLE_NAME_MISMATCH
    _heightheightVARIABLE_NAME_MISMATCH
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    11
    panel.setSize(new Dimension(width, height));
    12
    panel.setWidth(_width);
    12
    panel.setWidth(_width);
    12
    panel.setWidth(width);
    Differences
    Expression1Expression2Difference
    _widthwidthVARIABLE_NAME_MISMATCH
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setWidth(int)
    12
    panel.setWidth(width);
    13
    panel.setHeight(_width);
    13
    panel.setHeight(_width);
    13
    panel.setHeight(width);
    Differences
    Expression1Expression2Difference
    _widthwidthVARIABLE_NAME_MISMATCH
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setHeight(int)
    13
    panel.setHeight(width);
    14
    setBufferedImage(new BufferedImage(_width, _height, BufferedImage.TYPE_INT_RGB));
    14
    setBufferedImage(new BufferedImage(_width, _height, BufferedImage.TYPE_INT_RGB));
    14
    setBufferedImage(new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB));
    Differences
    Expression1Expression2Difference
    _widthwidthVARIABLE_NAME_MISMATCH
    _heightheightVARIABLE_NAME_MISMATCH
    14
    setBufferedImage(new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB));
    15
    panel.paintComponent(this.getBufferedImage().createGraphics());
    15
    panel.paintComponent(this.getBufferedImage().createGraphics());
    15
    panel.paintComponent(this.getBufferedImage().createGraphics());
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    15
    panel.paintComponent(this.getBufferedImage().createGraphics());
    16
    return panel;
    16
    return panel;
    16
    return panel;
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.visualizers.LineGraphorg.apache.jmeter.visualizers.AxisGraphSUBCLASS_TYPE_MISMATCH
    16
    return panel;
    Precondition Violations (13)
    Row Violation
    1Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setTitle(java.lang.String)
    2Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setData(double[][])
    3Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setXAxisLabels(java.lang.String[])
    4Unmatched statement panel.setYAxisLabels(this.getURLs().split(URL_DELIM)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setXAxisTitle(java.lang.String)
    6Expression panel.setYAxisTitle(this.getYAxis()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression panel.setYAxisLabels(this.getYLabel()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression panel.setYAxisTitle(this.getYAxis()) is a void method call, and thus it cannot be parameterized
    9Expression panel.setYAxisLabels(this.getYLabel()) is a void method call, and thus it cannot be parameterized
    10Unmatched statement panel.setYAxisTitle(this.getYAxis()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setWidth(int)
    12Expression panel cannot be unified with expression panel , because common superclass javax.swing.JPanel does not declare member(s) public void setHeight(int)
    13Clone fragment #1 returns variable panel with type org.apache.jmeter.visualizers.LineGraph , while Clone fragment #2 returns variable panel with type org.apache.jmeter.visualizers.AxisGraph