File path: /jEdit-4.2/src/org/gjt/sp/jedit/menu/RecentDirectoriesProvider.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/menu/RecentFilesProvider.java | |||
Method name: void update(JMenu)
|
Method name: void update(JMenu)
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | String path = model.getItem(i);↵ | 1 | String path = ((BufferHistory.Entry)iter.next()).path;↵ | |
2 | JMenuItem menuItem = new JMenuItem(MiscUtilities↵ | 2 | JMenuItem menuItem = new JMenuItem(MiscUtilities↵ | |
3 | .getFileName(path));↵ | 3 | .getFileName(path));↵ | |
4 | menuItem.setActionCommand(path);↵ | 4 | menuItem.setActionCommand(path);↵ | |
5 | menuItem.addActionListener(actionListener);↵ | 5 | menuItem.addActionListener(actionListener);↵ | |
6 | menuItem.addMouseListener(mouseListener);↵ | 6 | menuItem.addMouseListener(mouseListener);↵ | |
7 | menuItem.setIcon(FileCellRenderer.dirIcon);↵ | 7 | menuItem.setIcon(FileCellRenderer.fileIcon);↵ | |
8 | if(sort)↵ | 8 | if(sort)↵ | |
9 | menuItems.addElement(menuItem);↵ | 9 | menuItems.addElement(menuItem);↵ | |
10 | else↵ | 10 | else↵ | |
11 | {↵ | 11 | {↵ | |
12 | if(menu.getMenuComponentCount() >= maxItems↵ | 12 | if(menu.getMenuComponentCount() >= maxItems↵ | |
13 | && i != model.getSize() - 1)↵ | 13 | && iter.hasNext())↵ | |
14 | {↵ | 14 | {↵ | |
15 | JMenu newMenu = new JMenu(↵ | 15 | JMenu newMenu = new JMenu(↵ | |
16 | jEdit.getProperty("common.more"));↵ | 16 | jEdit.getProperty("common.more"));↵ | |
17 | menu.add(newMenu);↵ | 17 | menu.add(newMenu);↵ | |
18 | menu = newMenu;↵ | 18 | menu = newMenu;↵ | |
19 | }↵ | 19 | }↵ | |
20 | menu.add(menuItem);↵ | 20 | menu.add(menuItem);↵ | |
21 | } | 21 |
| |
See real code fragment | See real code fragment |
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.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 49 |
Number of mapped statements | 13 |
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) | 18.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14 | String path = model.getItem(i); |
| 15 | String path = ((BufferHistory.Entry)iter.next()).path; | |||||||||||
15 | JMenuItem menuItem = new JMenuItem(MiscUtilities.getFileName(path)); | 16 | JMenuItem menuItem = new JMenuItem(MiscUtilities.getFileName(path)); | ||||||||||||
16 | menuItem.setActionCommand(path); | 17 | menuItem.setActionCommand(path); | ||||||||||||
17 | menuItem.addActionListener(actionListener); | 18 | menuItem.addActionListener(actionListener); | ||||||||||||
18 | menuItem.addMouseListener(mouseListener); | 19 | menuItem.addMouseListener(mouseListener); | ||||||||||||
19 | menuItem.setIcon(FileCellRenderer.dirIcon); |
| 20 | menuItem.setIcon(FileCellRenderer.fileIcon); | |||||||||||
20 | if (sort) | 21 | if (sort) | ||||||||||||
21 | menuItems.addElement(menuItem); | 22 | menuItems.addElement(menuItem); | ||||||||||||
else | else | ||||||||||||||
22 | if (menu.getMenuComponentCount() >= maxItems && i != model.getSize() - 1) |
| 23 | if (menu.getMenuComponentCount() >= maxItems && iter.hasNext()) | |||||||||||
23 | JMenu newMenu = new JMenu(jEdit.getProperty("common.more")); | 24 | JMenu newMenu = new JMenu(jEdit.getProperty("common.more")); | ||||||||||||
24 | menu.add(newMenu); | 25 | menu.add(newMenu); | ||||||||||||
25 | menu = newMenu; | 26 | menu = newMenu; | ||||||||||||
26 | menu.add(menuItem); | 27 | menu.add(menuItem); |
Row | Violation |
---|---|
1 | Expression ((BufferHistory.Entry)iter.next()).path cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression iter.hasNext() cannot be parameterized, because it has dependencies to/from statements that will be extracted |