1091-1-3

restoreItem.setText(CommonUIPlugin.INSTANCE.getString("_UI_Restore_menu_item")); restoreItem.addSelectionListener (new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent selectionEvent) { doMaximize(); } });
newFolderButton = new Button(parent, SWT.PUSH); newFolderButton.setText(CommonUIPlugin.INSTANCE.getString("_UI_NewFolder_label")); newFolderButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { newFolderButtonPressed(); } });

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/ui/ViewerPane.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/common/ui/dialogs/WorkspaceResourceDialog.java
Method name: `void showTitleLabelMenu(MouseEvent)` |  | Method name: `void createNewFolderControl(Composite)`
Number of AST nodes: 2 |  | Number of AST nodes: 3

1

    restoreItem↵

1

    newFolderButton = new Button(parent, SWT.PUSH);↵

2

    .setText(CommonUIPlugin.INSTANCE.getString("_UI_Restore_menu_item"));↵

2

        newFolderButton.setText(CommonUIPlugin.INSTANCE.getString("_UI_↵

3

        restoreItem↵

3

    NewFolder_label"));↵

4

    .addSelectionListener↵

4

        newFolderButton.addSelectionListener↵

5

          (new SelectionAdapter() ↵

5

    (new SelectionAdapter()↵

6

     ↵

7

          {↵

6

          {↵

8

             @Override↵

7

            @Override↵

9

            public void widgetSelected(SelectionEvent selectionEvent) ↵

8

            public void widgetSelected(SelectionEvent event)↵

10

     ↵

11

            {↵

9

            {↵

12

               doMaximize();↵

10

              newFolderButtonPressed();↵

13

             }↵

11

            }↵

14

           });

12

          });

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

1. {Non-refactorable}

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

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

   1

       newFolderButton = new Button(parent, SWT.PUSH);

   4

       restoreItem.setText(CommonUIPlugin.INSTANCE.getString("_UI_Restore_menu_item"));

   4 | restoreItem.setText(CommonUIPlugin.INSTANCE.getString("_UI_Restore_menu_item"));
   2 | newFolderButton.setText(CommonUIPlugin.INSTANCE.getString("_UI_NewFolder_label"));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "_UI_Restore_menu_item" | "_UI_NewFolder_label" | LITERAL_VALUE_MISMATCH
   restoreItem | newFolderButton | VARIABLE_NAME_MISMATCH
   org.eclipse.swt.widgets.MenuItem | org.eclipse.swt.widgets.Button | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression restoreItem cannot be unified with expression newFolderButton , because common superclass org.eclipse.swt.widgets.Widget does not declare member(s) public void setText(java.lang.String)

   2

       newFolderButton.setText(CommonUIPlugin.INSTANCE.getString("_UI_NewFolder_label"));

   5

       restoreItem.addSelectionListener(new SelectionAdapter() {...});

   5 | restoreItem.addSelectionListener(new SelectionAdapter() {...});
   3 | newFolderButton.addSelectionListener(new SelectionAdapter() {...});

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   selectionEvent | event | VARIABLE_NAME_MISMATCH
   doMaximize | newFolderButtonPressed | METHOD_INVOCATION_NAME_MISMATCH
   restoreItem | newFolderButton | VARIABLE_NAME_MISMATCH
   org.eclipse.swt.widgets.MenuItem | org.eclipse.swt.widgets.Button | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression doMaximize() is a void method call, and thus it cannot be parameterized
   Expression newFolderButtonPressed() is a void method call, and thus it cannot be parameterized
   Expression restoreItem cannot be unified with expression newFolderButton , because common superclass org.eclipse.swt.widgets.Widget does not declare member(s) public void addSelectionListener(org.eclipse.swt.events.SelectionListener)

   3

       newFolderButton.addSelectionListener(new SelectionAdapter() {...});

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Expression restoreItem cannot be unified with expression newFolderButton , because common superclass org.eclipse.swt.widgets.Widget does not declare member(s) public void setText(java.lang.String)
   2 | Expression doMaximize() is a void method call, and thus it cannot be parameterized
   3 | Expression newFolderButtonPressed() is a void method call, and thus it cannot be parameterized
   4 | Expression restoreItem cannot be unified with expression newFolderButton , because common superclass org.eclipse.swt.widgets.Widget does not declare member(s) public void addSelectionListener(org.eclipse.swt.events.SelectionListener)