1413-1-2

text.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent event) { modify(tableItem, column, text); } }); text.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent event) { if (event.character == '\r' || event.character == '\n') { modify(tableItem, column, text); setEditor(null); text.dispose(); } else if (event.character == '\033') { setEditor(null); text.dispose(); } } });
text.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent event) { modify(tableItem, index, text); } }); text.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent event) { if (event.character == '\r' || event.character == '\n') { modify(tableItem, index, text); setEditor(null); text.dispose(); } else if (event.character == '\033') { setEditor(null); text.dispose(); } } });

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/ui/RoseDetailPage.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/converter/ui/contribution/base/ModelConverterPackagePage.java
Method name: `void editItem(TableItem, int)` |  | Method name: `void editItem(TableItem, int)`
Number of AST nodes: 2 |  | Number of AST nodes: 2

1

    text.addFocusListener(new FocusAdapter()↵

1

    text.addFocusListener(new FocusAdapter()↵

2

                  {↵

2

                ↵

3

      ↵

3

    {↵

4

                  @Override↵

4

                  @Override↵

5

                    public void focusLost(FocusEvent event)↵

5

                  public void focusLost(FocusEvent event)↵

6

                    {↵

6

                  {↵

7

                      modify(tableItem, column, text);↵

7

                    modify(tableItem, index, text);↵

8

                    }↵

8

                  ↵

9

      ↵

9

    }↵

10

                });↵

10

                });↵

11

     ↵

12

      ↵

13

              text.addKeyListener(new KeyAdapter()↵

11

              text.addKeyListener(new KeyAdapter()↵

14

                  {↵

12

                {↵

15

                    @Override↵

13

                  @Override↵

16

                    public void keyPressed(KeyEvent event)↵

14

                  public void keyPressed(KeyEvent event)↵

17

                    {↵

15

                  {↵

18

                      if (event.character == '\r' || event.character == '\n')↵

16

                    if (event.character == '\r' || event.character == '\n')↵

19

                      {↵

17

                    ↵

20

      ↵

18

    {↵

21

                      modify(tableItem, column, text);↵

19

                      modify(tableItem, index, text);↵

22

                        setEditor(null);↵

20

                      setEditor(null);↵

23

                        text.dispose();↵

21

                      text.dispose();↵

24

                      }↵

22

                    ↵

25

      ↵

23

    }↵

26

                    else if (event.character == '\033')↵

24

                    else if (event.character == '\033')↵

27

                      {↵

25

                    ↵

28

      ↵

26

    {↵

29

                      setEditor(null);↵

27

                      setEditor(null);↵

30

                        text.dispose();↵

28

                      text.dispose();↵

31

                      }↵

29

                    }↵

32

                    }↵

30

                  ↵

33

      ↵

31

    }↵

34

                });

32

                });

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 having the same super class
Number of node comparisons | 0

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 0
   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 | Unknown type

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

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