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)); } } } );
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/SWTPlotAppearanceEditor.java File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/editor/SWTPlotAppearanceEditor.java
Method name: void SWTPlotAppearanceEditor(Composite, int, Plot) Method name: void SWTPlotAppearanceEditor(Composite, int, Plot)
Number of AST nodes: 1 Number of AST nodes: 1
1
selectOutlineColor.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
                                "Outline_Paint"));
6
                                "Background_paint"));
7
                        dlg.setRGB(SWTPlotAppearanceEditor.this
7
                        dlg.setRGB(SWTPlotAppearanceEditor.this
8
                                .outlinePaintCanvas.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
                            SWTPlotAppearanceEditor.this.outlinePaintCanvas
11
                            SWTPlotAppearanceEditor.this.backgroundPaintCanvas
12
                                    .setColor(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 cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in the same method
Number of node comparisons1
  1. {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
    29
    selectOutlineColor.addSelectionListener(new SelectionAdapter() {...});
    29
    selectOutlineColor.addSelectionListener(new SelectionAdapter() {...});
    38
    selectBgPaint.addSelectionListener(new SelectionAdapter() {...});
    Differences
    Expression1Expression2Difference
    "Outline_Paint""Background_paint"LITERAL_VALUE_MISMATCH
    outlinePaintCanvasbackgroundPaintCanvasVARIABLE_NAME_MISMATCH
    outlinePaintCanvasbackgroundPaintCanvasVARIABLE_NAME_MISMATCH
    selectOutlineColorselectBgPaintVARIABLE_NAME_MISMATCH
    38
    selectBgPaint.addSelectionListener(new SelectionAdapter() {...});
    Precondition Violations (0)
    Row Violation