1026-1-2

this.autoRange = this.autoRangeCheckBox.isSelected(); if (this.autoRange) { this.minimumRangeValue.setText(Double.toString(this.minimumValue)); this.minimumRangeValue.setEnabled(false); this.maximumRangeValue.setText(Double.toString(this.maximumValue)); this.maximumRangeValue.setEnabled(false); } else { this.minimumRangeValue.setEnabled(true); this.maximumRangeValue.setEnabled(true); }
this.autoRange = this.autoRangeCheckBox.getSelection(); if (this.autoRange) { this.minimumRangeValue.setText(Double.toString(this.minimumValue)); this.minimumRangeValue.setEnabled(false); this.maximumRangeValue.setText(Double.toString(this.maximumValue)); this.maximumRangeValue.setEnabled(false); } else { this.minimumRangeValue.setEnabled(true); this.maximumRangeValue.setEnabled(true); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultNumberAxisEditor.java |  | File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/editor/SWTNumberAxisEditor.java
Method name: `void toggleAutoRange()` |  | Method name: `void toggleAutoRange()`
Number of AST nodes: 8 |  | Number of AST nodes: 8

1

    this.autoRange = this.autoRangeCheckBox.isSelected();
    ↵

1

    this.autoRange = this.autoRangeCheckBox.getSelection();↵

2

            if (this.autoRange) {
    ↵

2

            if (this.autoRange) {↵

3

                this.minimumRangeValue.setText(Double.toString(this.minimumValue));
    ↵

3

                this.minimumRangeValue.setText(Double.toString(this.minimumValue));↵

4

                this.minimumRangeValue.setEnabled(false);
    ↵

4

                this.minimumRangeValue.setEnabled(false);↵

5

                this.maximumRangeValue.setText(Double.toString(this.maximumValue));
    ↵

5

                this.maximumRangeValue.setText(Double.toString(this.maximumValue));↵

6

                this.maximumRangeValue.setEnabled(false);
    ↵

6

                this.maximumRangeValue.setEnabled(false);↵

7

            }
    ↵

7

            }↵

8

            else {
    ↵

8

            else {↵

9

                this.minimumRangeValue.setEnabled(true);
    ↵

9

                this.minimumRangeValue.setEnabled(true);↵

10

                this.maximumRangeValue.setEnabled(true);
    ↵

10

                this.maximumRangeValue.setEnabled(true);↵

11

            }

11

            }

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.1
Clones location | Clones are in different classes
Number of node comparisons | 50

1. {Non-refactorable}

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

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

   1

       this.autoRange = this.autoRangeCheckBox.isSelected();

   1 | this.autoRange = this.autoRangeCheckBox.isSelected();
   1 | this.autoRange = this.autoRangeCheckBox.getSelection();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   isSelected | getSelection | METHOD_INVOCATION_NAME_MISMATCH
   javax.swing.JCheckBox | org.eclipse.swt.widgets.Button | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type javax.swing.JCheckBox of variable this.autoRangeCheckBox does not match with type org.eclipse.swt.widgets.Button of variable this.autoRangeCheckBox
   - Make classes javax.swing.JCheckBox and org.eclipse.swt.widgets.Button extend a common superclass

   1

       this.autoRange = this.autoRangeCheckBox.getSelection();

   2

       if (this.autoRange)

   2

       if (this.autoRange)

   3

       this.minimumRangeValue.setText(Double.toString(this.minimumValue));

   3 | this.minimumRangeValue.setText(Double.toString(this.minimumValue));
   3 | this.minimumRangeValue.setText(Double.toString(this.minimumValue));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   javax.swing.JTextField | org.eclipse.swt.widgets.Text | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type javax.swing.JTextField of variable this.minimumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.minimumRangeValue
   - Make classes javax.swing.JTextField and org.eclipse.swt.widgets.Text extend a common superclass

   3

       this.minimumRangeValue.setText(Double.toString(this.minimumValue));

   4

       this.minimumRangeValue.setEnabled(false);

   4 | this.minimumRangeValue.setEnabled(false);
   4 | this.minimumRangeValue.setEnabled(false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   javax.swing.JTextField | org.eclipse.swt.widgets.Text | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type javax.swing.JTextField of variable this.minimumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.minimumRangeValue
   - Make classes javax.swing.JTextField and org.eclipse.swt.widgets.Text extend a common superclass

   4

       this.minimumRangeValue.setEnabled(false);

   5

       this.maximumRangeValue.setText(Double.toString(this.maximumValue));

   5 | this.maximumRangeValue.setText(Double.toString(this.maximumValue));
   5 | this.maximumRangeValue.setText(Double.toString(this.maximumValue));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   javax.swing.JTextField | org.eclipse.swt.widgets.Text | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type javax.swing.JTextField of variable this.maximumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.maximumRangeValue
   - Make classes javax.swing.JTextField and org.eclipse.swt.widgets.Text extend a common superclass

   5

       this.maximumRangeValue.setText(Double.toString(this.maximumValue));

   6

       this.maximumRangeValue.setEnabled(false);

   6 | this.maximumRangeValue.setEnabled(false);
   6 | this.maximumRangeValue.setEnabled(false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   javax.swing.JTextField | org.eclipse.swt.widgets.Text | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type javax.swing.JTextField of variable this.maximumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.maximumRangeValue
   - Make classes javax.swing.JTextField and org.eclipse.swt.widgets.Text extend a common superclass

   6

       this.maximumRangeValue.setEnabled(false);

       else

       else

   7

       this.minimumRangeValue.setEnabled(true);

   7 | this.minimumRangeValue.setEnabled(true);
   7 | this.minimumRangeValue.setEnabled(true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   javax.swing.JTextField | org.eclipse.swt.widgets.Text | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type javax.swing.JTextField of variable this.minimumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.minimumRangeValue
   - Make classes javax.swing.JTextField and org.eclipse.swt.widgets.Text extend a common superclass

   7

       this.minimumRangeValue.setEnabled(true);

   8

       this.maximumRangeValue.setEnabled(true);

   8 | this.maximumRangeValue.setEnabled(true);
   8 | this.maximumRangeValue.setEnabled(true);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   javax.swing.JTextField | org.eclipse.swt.widgets.Text | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type javax.swing.JTextField of variable this.maximumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.maximumRangeValue
   - Make classes javax.swing.JTextField and org.eclipse.swt.widgets.Text extend a common superclass

   8

       this.maximumRangeValue.setEnabled(true);

   Precondition Violations (7)
   Row | Violation
   --- | ---
   1 | Type javax.swing.JCheckBox of variable this.autoRangeCheckBox does not match with type org.eclipse.swt.widgets.Button of variable this.autoRangeCheckBox
   2 | Type javax.swing.JTextField of variable this.minimumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.minimumRangeValue
   3 | Type javax.swing.JTextField of variable this.minimumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.minimumRangeValue
   4 | Type javax.swing.JTextField of variable this.maximumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.maximumRangeValue
   5 | Type javax.swing.JTextField of variable this.maximumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.maximumRangeValue
   6 | Type javax.swing.JTextField of variable this.minimumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.minimumRangeValue
   7 | Type javax.swing.JTextField of variable this.maximumRangeValue does not match with type org.eclipse.swt.widgets.Text of variable this.maximumRangeValue