if ( menu == null ) throw new IllegalArgumentException("menu == null");
Enumeration<ExtendableMenu> e = menu.getSubmenuEnumeration();
while (e.hasMoreElements()) {
ExtendableMenu submenu = e.nextElement();
map.put(submenu.getId(), submenu);
}
if ( menu == null ) throw new IllegalArgumentException("menu == null");
Enumeration<ExtendableMenu> e = menu.getSubmenuEnumeration();
while (e.hasMoreElements()) {
ExtendableMenu submenu = e.nextElement();
map.put(submenu.getId(), submenu);
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/menu/ExtendableMenuBar.java
|
|
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/menu/ExtendableMenuBar.java
|
Method name: void insert(ExtendableMenu)
|
|
Method name: void add(ExtendableMenu)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if ( menu == null ) throw new IllegalArgumentException("menu == null");↵ | | 1 | if ( menu == null ) throw new IllegalArgumentException("menu == null");↵
|
2 | ↵ | | 2 | ↵
|
3 | Enumeration<ExtendableMenu> e = menu.getSubmenuEnumeration();↵ | | 3 | Enumeration<ExtendableMenu> e = menu.getSubmenuEnumeration();↵
|
4 | while (e.hasMoreElements()) {↵ | | 4 | while (e.hasMoreElements()) {↵
|
5 | ExtendableMenu submenu = e.nextElement();↵ | | 5 | ExtendableMenu submenu = e.nextElement();↵
|
6 | map.put(submenu.getId(), submenu);↵ | | 6 | map.put(submenu.getId(), submenu);↵
|
7 | } | | 7 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 21 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 1.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (menu == null) | | 1 | if (menu == null) |
2 | throw new IllegalArgumentException("menu == null"); | | 2 | throw new IllegalArgumentException("menu == null"); |
3 | Enumeration<ExtendableMenu> e = menu.getSubmenuEnumeration(); | | 3 | Enumeration<ExtendableMenu> e = menu.getSubmenuEnumeration(); |
4 | while (e.hasMoreElements()) | | 4 | while (e.hasMoreElements()) |
5 | ExtendableMenu submenu = e.nextElement(); | | 5 | ExtendableMenu submenu = e.nextElement(); |
6 | map.put(submenu.getId(), submenu); | | 6 | map.put(submenu.getId(), submenu); |
Precondition Violations (0)
Row |
Violation |