PlasticTheme[] themes = computeThemes();
for (int i = 0; i < themes.length; i++) {
String str = themes[i].getName();
if (name.equals(str)) {
return themes[i];
}
}
return null;
PlasticTheme[] themes = computeThemes();
for (int i = 0; i < themes.length; i++) {
String str = themes[i].getName();
if (name.equals(str)) {
return themes[i];
}
}
return null;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/themes/plugin/PlasticLookAndFeelConfigPlugin.java
|
|
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/themes/plugin/PlasticLookAndFeelPlugin.java
|
Method name: PlasticTheme getTheme(String)
|
|
Method name: PlasticTheme getTheme(String)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | PlasticTheme[] themes = computeThemes();↵ | | 1 | PlasticTheme[] themes = computeThemes();↵
|
|
2 | for (int i = 0; i < themes.length; i++) {↵ | | 2 | for (int i = 0; i < themes.length; i++) {↵
|
3 | String str = themes[i].getName();↵ | | 3 | String str = themes[i].getName();↵
|
|
4 | if (name.equals(str)) {↵ | | 4 | if (name.equals(str)) {↵
|
5 | return themes[i];↵ | | 5 | return themes[i];↵
|
6 | }↵ | | |
|
7 | }↵ | | |
|
|
8 | ↵ | | 6 | }↵
|
| | | 7 | }↵
|
|
9 | return null; | | 8 | return null;
|
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 in different classes |
Number of node comparisons | 12 |
-
{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) | 0.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | PlasticTheme[] themes = computeThemes(); | | 1 | PlasticTheme[] themes = computeThemes(); |
2 | for (int i = 0; i < themes.length; i++) | | 2 | for (int i = 0; i < themes.length; i++) |
3 | String str = themes[i].getName(); | | 3 | String str = themes[i].getName(); |
4 | | | 4 | |
5 | | | 5 | |
6 | return null; | | 6 | return null; |
Precondition Violations (0)
Row |
Violation |