selectBgPaint.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { ColorDialog dlg = new ColorDialog(getShell()); dlg.setText(localizationResources.getString( "Background_paint")); dlg.setRGB(SWTOtherEditor.this.backgroundPaintCanvas .getColor().getRGB()); RGB rgb = dlg.open(); if (rgb != null) { SWTOtherEditor.this.backgroundPaintCanvas.setColor( new Color(getDisplay(), rgb)); } } } );
selectOutlineColor.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { ColorDialog dlg = new ColorDialog(getShell()); dlg.setText(localizationResources.getString( "Outline_Paint")); dlg.setRGB(SWTPlotAppearanceEditor.this .outlinePaintCanvas.getColor().getRGB()); RGB rgb = dlg.open(); if (rgb != null) { SWTPlotAppearanceEditor.this.outlinePaintCanvas .setColor(new Color(getDisplay(), rgb)); } } } );
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/editor/SWTOtherEditor.java File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/editor/SWTPlotAppearanceEditor.java
Method name: void SWTOtherEditor(Composite, int, JFreeChart) Method name: void SWTPlotAppearanceEditor(Composite, int, Plot)
Number of AST nodes: 1 Number of AST nodes: 1
1
selectBgPaint.addSelectionListener(
1
selectOutlineColor.addSelectionListener(
2
                new SelectionAdapter() {
2
                new SelectionAdapter() {
3
                    public void widgetSelected(SelectionEvent event) {
3
                    public void widgetSelected(SelectionEvent event) {
4
                        ColorDialog dlg = new ColorDialog(getShell());
4
                        ColorDialog dlg = new ColorDialog(getShell());
5
                        dlg.setText(localizationResources.getString(
5
                        dlg.setText(localizationResources.getString(
6
                                "Background_paint"));
6
                                "Outline_Paint"));
7
                        dlg.setRGB(SWTOtherEditor.this.backgroundPaintCanvas
7
                        dlg.setRGB(SWTPlotAppearanceEditor.this
8
                                .getColor().getRGB());
8
                                .outlinePaintCanvas.getColor().getRGB());
9
                        RGB rgb = dlg.open();
9
                        RGB rgb = dlg.open();
10
                        if (rgb != null) {
10
                        if (rgb != null) {
11
                            SWTOtherEditor.this.backgroundPaintCanvas.setColor(
11
                            SWTPlotAppearanceEditor.this.outlinePaintCanvas
12
                                    new Color(getDisplay(), rgb));
12
                                    .setColor(new Color(getDisplay(), rgb));
13
                        }
13
                        }
14
                    }
14
                    }
15
                }
15
                }
16
        );
16
        );
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 comparisons1
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    20
    selectBgPaint.addSelectionListener(new SelectionAdapter() {...});
    20
    selectBgPaint.addSelectionListener(new SelectionAdapter() {...});
    29
    selectOutlineColor.addSelectionListener(new SelectionAdapter() {...});
    Differences
    Expression1Expression2Difference
    "Background_paint""Outline_Paint"LITERAL_VALUE_MISMATCH
    org.jfree.experimental.chart.swt.editor.SWTOtherEditororg.jfree.experimental.chart.swt.editor.SWTPlotAppearanceEditorSUBCLASS_TYPE_MISMATCH
    backgroundPaintCanvasoutlinePaintCanvasVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.swt.editor.SWTOtherEditororg.jfree.experimental.chart.swt.editor.SWTPlotAppearanceEditorSUBCLASS_TYPE_MISMATCH
    backgroundPaintCanvasoutlinePaintCanvasVARIABLE_NAME_MISMATCH
    selectBgPaintselectOutlineColorVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression SWTOtherEditor cannot be unified with expression SWTPlotAppearanceEditor , because common superclass org.eclipse.swt.widgets.Composite does not declare member(s) protected static java.util.ResourceBundle localizationResources
    Expression SWTOtherEditor cannot be unified with expression SWTPlotAppearanceEditor , because common superclass org.eclipse.swt.widgets.Composite does not declare member(s) protected static java.util.ResourceBundle localizationResources
    29
    selectOutlineColor.addSelectionListener(new SelectionAdapter() {...});
    Precondition Violations (2)
    Row Violation
    1Expression SWTOtherEditor cannot be unified with expression SWTPlotAppearanceEditor , because common superclass org.eclipse.swt.widgets.Composite does not declare member(s) protected static java.util.ResourceBundle localizationResources
    2Expression SWTOtherEditor cannot be unified with expression SWTPlotAppearanceEditor , because common superclass org.eclipse.swt.widgets.Composite does not declare member(s) protected static java.util.ResourceBundle localizationResources