if (OSInfo.isLinux()) {
activeDesktop = new JDICDesktop();
} else if (OSInfo.isWin32Platform()) {
activeDesktop = new JDICDesktop();
} else if (OSInfo.isMac()) {
activeDesktop = new MacDesktop();
}
if (OSInfo.isLinux()) {
activeIcon = new JDICTrayIcon();
} else if (OSInfo.isWin32Platform()) {
activeIcon = new JDICTrayIcon();
} else if (OSInfo.isMac()) {
// tray icon not supported on Mac
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/desktop/ColumbaDesktop.java
|
|
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/trayicon/ColumbaTrayIcon.java
|
Method name: void initActiveDesktop()
|
|
Method name: void initActiveIcon()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 5
|
|
1 | if (OSInfo.isLinux()) {↵ | | 1 | if (OSInfo.isLinux()) {↵
|
2 | activeDesktop = new JDICDesktop();↵ | | 2 | activeIcon = new JDICTrayIcon();↵
|
3 | } else if (OSInfo.isWin32Platform()) {↵ | | 3 | } else if (OSInfo.isWin32Platform()) {↵
|
4 | activeDesktop = new JDICDesktop();↵ | | 4 | activeIcon = new JDICTrayIcon();↵
|
5 | } else if (OSInfo.isMac()) {↵ | | 5 | } else if (OSInfo.isMac()) {↵
|
6 | activeDesktop = new MacDesktop();↵ | | 6 | // tray icon not supported on Mac↵
|
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.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 22 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | if (OSInfo.isLinux()) | | 2 | if (OSInfo.isLinux()) |
| | | 3 | activeIcon = new JDICTrayIcon(); |
3 | activeDesktop = new JDICDesktop(); | | | |
4 | else if (OSInfo.isWin32Platform()) | | 4 | else if (OSInfo.isWin32Platform()) |
| | | 5 | activeIcon = new JDICTrayIcon(); |
5 | activeDesktop = new JDICDesktop(); | | | |
6 | | | 6 | |
7 | activeDesktop = new MacDesktop(); | | | |
Precondition Violations (0)
Row |
Violation |