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)); } } } );
selectBgPaint.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { ColorDialog dlg = new ColorDialog(getShell()); dlg.setText(localizationResources.getString( "Background_paint")); dlg.setRGB(SWTPlotAppearanceEditor.this .backgroundPaintCanvas.getColor().getRGB()); RGB rgb = dlg.open(); if (rgb != null) { SWTPlotAppearanceEditor.this.backgroundPaintCanvas .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
selectBgPaint.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
                                "Background_paint"));
7
                        dlg.setRGB(SWTOtherEditor.this.backgroundPaintCanvas
7
                        dlg.setRGB(SWTPlotAppearanceEditor.this
8
                                .getColor().getRGB());
8
                                .backgroundPaintCanvas.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.backgroundPaintCanvas
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() {...});
    38
    selectBgPaint.addSelectionListener(new SelectionAdapter() {...});
    Differences
    Expression1Expression2Difference
    org.jfree.experimental.chart.swt.editor.SWTOtherEditororg.jfree.experimental.chart.swt.editor.SWTPlotAppearanceEditorSUBCLASS_TYPE_MISMATCH
    org.jfree.experimental.chart.swt.editor.SWTOtherEditororg.jfree.experimental.chart.swt.editor.SWTPlotAppearanceEditorSUBCLASS_TYPE_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, private org.jfree.experimental.swt.SWTPaintCanvas backgroundPaintCanvas
    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, private org.jfree.experimental.swt.SWTPaintCanvas backgroundPaintCanvas
    38
    selectBgPaint.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, private org.jfree.experimental.swt.SWTPaintCanvas backgroundPaintCanvas
    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, private org.jfree.experimental.swt.SWTPaintCanvas backgroundPaintCanvas