1091-1-2

restoreItem.setText(CommonUIPlugin.INSTANCE.getString("_UI_Restore_menu_item")); restoreItem.addSelectionListener (new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent selectionEvent) { doMaximize(); } });
maximizeItem.setText(CommonUIPlugin.INSTANCE.getString("_UI_Maximize_menu_item")); maximizeItem.addSelectionListener (new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent selectionEvent) { doMaximize(); } });

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/ViewerPane.java
Method name: `void showTitleLabelMenu(MouseEvent)` |  | Method name: `void showTitleLabelMenu(MouseEvent)`
Number of AST nodes: 2 |  | Number of AST nodes: 2

1

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

1

    maximizeItem.setText(CommonUIPlugin.INSTANCE.getString("_UI_Maximize_menu_item"));↵

2

        restoreItem.addSelectionListener↵

2

        maximizeItem.addSelectionListener↵

3

          (new SelectionAdapter() ↵

3

          (new SelectionAdapter() ↵

4

           {↵

4

           {↵

5

             @Override↵

5

             @Override↵

6

            public void widgetSelected(SelectionEvent selectionEvent) ↵

6

            public void widgetSelected(SelectionEvent selectionEvent) ↵

7

             {↵

7

             {↵

8

               doMaximize();↵

8

               doMaximize();↵

9

             }↵

9

             }↵

10

           });

10

           });

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location | Clones are in the same method
Number of node comparisons | 4

1. {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 | 0
   Time elapsed for statement mapping (ms) | 0.0
   Clone type | Type 2

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

   4

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

   4 | restoreItem.setText(CommonUIPlugin.INSTANCE.getString("_UI_Restore_menu_item"));
   8 | maximizeItem.setText(CommonUIPlugin.INSTANCE.getString("_UI_Maximize_menu_item"));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "_UI_Restore_menu_item" | "_UI_Maximize_menu_item" | LITERAL_VALUE_MISMATCH
   restoreItem | maximizeItem | VARIABLE_NAME_MISMATCH

   8

       maximizeItem.setText(CommonUIPlugin.INSTANCE.getString("_UI_Maximize_menu_item"));

   5

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

   5 | restoreItem.addSelectionListener(new SelectionAdapter() {...});
   9 | maximizeItem.addSelectionListener(new SelectionAdapter() {...});

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   restoreItem | maximizeItem | VARIABLE_NAME_MISMATCH

   9

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

   Precondition Violations (0)
   Row | Violation
   --- | ---