ResourceBundle bundle = null;
String bundlePath = i18nPath + "." + resourceBundleName;
try {
bundle = ResourceBundle.getBundle(bundlePath, Locale.getDefault());
return bundle.getString(resourceName);
} catch (MissingResourceException e) {
// fall-back to global resource loader
return GlobalResourceLoader.getString(null, resourceBundleName,
resourceName);
}
ResourceBundle bundle = null;
String bundlePath = i18nPath + "." + resourceBundleName;
try {
bundle = ResourceBundle.getBundle(bundlePath, Locale.getDefault());
return bundle.getString(resourceName);
} catch (MissingResourceException e) {
// fall-back to global resource loader
return GlobalResourceLoader.getString(null, resourceBundleName,
resourceName);
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/resourceloader/ResourceLoader.java
|
|
File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/resourceloader/ResourceLoader.java
|
Method name: String getString(String, String)
|
|
Method name: String getString(String, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | ResourceBundle bundle = null;↵ | | 1 | ResourceBundle bundle = null;↵
|
|
2 | String bundlePath = i18nPath + "." + resourceBundleName;↵ | | 2 | String bundlePath = i18nPath + "." + resourceBundleName;↵
|
|
3 | try {↵ | | 3 | try {↵
|
4 | bundle = ResourceBundle.getBundle(bundlePath, Locale.getDefault());↵ | | 4 | bundle = ResourceBundle.getBundle(bundlePath, Locale.getDefault());↵
|
|
5 | return bundle.getString(resourceName);↵ | | 5 | return bundle.getString(resourceName);↵
|
6 | } catch (MissingResourceException e) {↵ | | 6 | } catch (MissingResourceException e) {↵
|
| | | 7 | ↵
|
7 | // fall-back to global resource loader↵ | | 8 | // fall-back to global resource loader↵
|
8 | return GlobalResourceLoader.getString(null, resourceBundleName,↵ | | 9 | return GlobalResourceLoader.getString(null, resourceBundleName,↵
|
9 | resourceName);↵ | | 10 | resourceName);↵
|
10 | } | | 11 | }
|
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 | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 2.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | ResourceBundle bundle = null; | | 1 | ResourceBundle bundle = null; |
2 | String bundlePath = i18nPath + "." + resourceBundleName; | | 2 | String bundlePath = i18nPath + "." + resourceBundleName; |
3 | try | | 3 | try |
4 | bundle = ResourceBundle.getBundle(bundlePath, Locale.getDefault()); | | 4 | bundle = ResourceBundle.getBundle(bundlePath, Locale.getDefault()); |
5 | return bundle.getString(resourceName); | | 5 | return bundle.getString(resourceName); |
Precondition Violations (0)
Row |
Violation |