if (this.drawLines != null) { interior.add( new JLabel(localizationResources.getString("Draw_lines")) ); this.drawLinesCheckBox = new JCheckBox(); this.drawLinesCheckBox.setSelected(this.drawLines.booleanValue()); this.drawLinesCheckBox.setActionCommand("DrawLines"); this.drawLinesCheckBox.addActionListener(this); interior.add(new JPanel()); interior.add(this.drawLinesCheckBox); }
if (this.drawShapes != null) { interior.add( new JLabel(localizationResources.getString("Draw_shapes")) ); this.drawShapesCheckBox = new JCheckBox(); this.drawShapesCheckBox.setSelected(this.drawShapes.booleanValue()); this.drawShapesCheckBox.setActionCommand("DrawShapes"); this.drawShapesCheckBox.addActionListener(this); interior.add(new JPanel()); interior.add(this.drawShapesCheckBox); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultPlotEditor.java File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultPlotEditor.java
Method name: void DefaultPlotEditor(Plot) Method name: void DefaultPlotEditor(Plot)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (this.drawLines != null) {
1
if (this.drawShapes != null) {
2
            interior.add(
2
            interior.add(
3
                new JLabel(localizationResources.getString("Draw_lines"))
3
                new JLabel(localizationResources.getString("Draw_shapes"))
4
            );
4
            );
5
            this.drawLinesCheckBox = new JCheckBox();
5
            this.drawShapesCheckBox = new JCheckBox();
6
            this.drawLinesCheckBox.setSelected(this.drawLines.booleanValue());
6
            this.drawShapesCheckBox.setSelected(this.drawShapes.booleanValue());
7
            this.drawLinesCheckBox.setActionCommand("DrawLines");
7
            this.drawShapesCheckBox.setActionCommand("DrawShapes");
8
            this.drawLinesCheckBox.addActionListener(this);
8
            this.drawShapesCheckBox.addActionListener(this);
9
            interior.add(new JPanel());
9
            interior.add(new JPanel());
10
            interior.add(this.drawLinesCheckBox);
10
            interior.add(this.drawShapesCheckBox);
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.1
Clones locationClones are in the same method
Number of node comparisons64
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    60
    if (this.drawLines != null)
    60
    if (this.drawLines != null)
    68
    if (this.drawShapes != null)
    Differences
    Expression1Expression2Difference
    drawLinesdrawShapesVARIABLE_NAME_MISMATCH
    68
    if (this.drawShapes != null)
    61
    interior.add(new JLabel(localizationResources.getString("Draw_lines")));
    61
    interior.add(new JLabel(localizationResources.getString("Draw_lines")));
    69
    interior.add(new JLabel(localizationResources.getString("Draw_shapes")));
    Differences
    Expression1Expression2Difference
    "Draw_lines""Draw_shapes"LITERAL_VALUE_MISMATCH
    69
    interior.add(new JLabel(localizationResources.getString("Draw_shapes")));
    62
    this.drawLinesCheckBox = new JCheckBox();
    62
    this.drawLinesCheckBox = new JCheckBox();
    70
    this.drawShapesCheckBox = new JCheckBox();
    Differences
    Expression1Expression2Difference
    drawLinesCheckBoxdrawShapesCheckBoxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.drawLinesCheckBox is a field being modified, and thus it cannot be parameterized
    Expression this.drawShapesCheckBox is a field being modified, and thus it cannot be parameterized
    70
    this.drawShapesCheckBox = new JCheckBox();
    63
    this.drawLinesCheckBox.setSelected(this.drawLines.booleanValue());
    63
    this.drawLinesCheckBox.setSelected(this.drawLines.booleanValue());
    71
    this.drawShapesCheckBox.setSelected(this.drawShapes.booleanValue());
    Differences
    Expression1Expression2Difference
    drawLinesdrawShapesVARIABLE_NAME_MISMATCH
    drawLinesCheckBoxdrawShapesCheckBoxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.drawLinesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.drawShapesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    71
    this.drawShapesCheckBox.setSelected(this.drawShapes.booleanValue());
    64
    this.drawLinesCheckBox.setActionCommand("DrawLines");
    64
    this.drawLinesCheckBox.setActionCommand("DrawLines");
    72
    this.drawShapesCheckBox.setActionCommand("DrawShapes");
    Differences
    Expression1Expression2Difference
    "DrawLines""DrawShapes"LITERAL_VALUE_MISMATCH
    drawLinesCheckBoxdrawShapesCheckBoxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.drawLinesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.drawShapesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    72
    this.drawShapesCheckBox.setActionCommand("DrawShapes");
    65
    this.drawLinesCheckBox.addActionListener(this);
    65
    this.drawLinesCheckBox.addActionListener(this);
    73
    this.drawShapesCheckBox.addActionListener(this);
    Differences
    Expression1Expression2Difference
    drawLinesCheckBoxdrawShapesCheckBoxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.drawLinesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.drawShapesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    73
    this.drawShapesCheckBox.addActionListener(this);
    66
    interior.add(new JPanel());
    74
    interior.add(new JPanel());
    67
    interior.add(this.drawLinesCheckBox);
    67
    interior.add(this.drawLinesCheckBox);
    75
    interior.add(this.drawShapesCheckBox);
    Differences
    Expression1Expression2Difference
    drawLinesCheckBoxdrawShapesCheckBoxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.drawLinesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.drawShapesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    75
    interior.add(this.drawShapesCheckBox);
    Precondition Violations (10)
    Row Violation
    1Expression this.drawLinesCheckBox is a field being modified, and thus it cannot be parameterized
    2Expression this.drawShapesCheckBox is a field being modified, and thus it cannot be parameterized
    3Expression this.drawLinesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.drawShapesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.drawLinesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression this.drawShapesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression this.drawLinesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression this.drawShapesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression this.drawLinesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression this.drawShapesCheckBox cannot be parameterized, because it has dependencies to/from statements that will be extracted