try {
XMLBeanWriter wtr = new XMLBeanWriter(_prefs);
wtr.save(new File(_userSettingsFolder, USER_PREFS_FILE_NAME));
} catch (Exception ex) {
s_log.error("Error occured writing to preferences file: "
+ USER_PREFS_FILE_NAME, ex);
}
try
{
XMLBeanWriter wtr = new XMLBeanWriter(_prefs);
wtr.save(new File(_userSettingsFolder, USER_PREFS_FILE_NAME));
}
catch (Exception ex)
{
// i18n[exportconfig.errorWritingPrefs=Error occured writing to preferences file: {0}]
s_log.error(s_stringMgr.getString("exportconfig.errorWritingPrefs", USER_PREFS_FILE_NAME), ex);
}
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/prefs/RefactoringPreferencesManager.java
|
|
File path: /sql12/plugins/exportconfig/src/net/sourceforge/squirrel_sql/plugins/exportconfig/ExportConfigPlugin.java
|
Method name: void savePrefs()
|
|
Method name: void savePrefs()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | try {↵ | | 1 | try↵
|
2 | ↵ | | |
|
| | | 2 | {↵
|
3 | XMLBeanWriter wtr = new XMLBeanWriter(_prefs);↵ | | 3 | XMLBeanWriter wtr = new XMLBeanWriter(_prefs);↵
|
4 | wtr.save(new File(_userSettingsFolder, USER_PREFS_FILE_NAME));↵ | | 4 | wtr.save(new File(_userSettingsFolder, USER_PREFS_FILE_NAME));↵
|
5 | } ↵ | | 5 | }↵
|
6 | catch (Exception ex) {↵ | | 6 | catch (Exception ex)↵
|
7 | s_log.error("Error occured writing to preferences file: "↵ | | |
|
8 | +↵ | | |
|
| | | 7 | {↵
|
| | | 8 | // i18n[exportconfig.errorWritingPrefs=Error occured writing to preferences file: {0}]↵
|
9 | USER_PREFS_FILE_NAME, ex);↵ | | 9 | s_log.error(s_stringMgr.getString("exportconfig.errorWritingPrefs", USER_PREFS_FILE_NAME), ex);↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 4.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
2 | XMLBeanWriter wtr = new XMLBeanWriter(_prefs); | | 2 | XMLBeanWriter wtr = new XMLBeanWriter(_prefs); |
3 | wtr.save(new File(_userSettingsFolder, USER_PREFS_FILE_NAME)); | | 3 | wtr.save(new File(_userSettingsFolder, USER_PREFS_FILE_NAME)); |
Precondition Violations (2)
Row |
Violation |
1 | Type net.sourceforge.squirrel_sql.plugins.refactoring.prefs.RefactoringPreferenceBean of variable _prefs does not match with type net.sourceforge.squirrel_sql.plugins.exportconfig.ExportConfigPreferences of variable _prefs |
2 | The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.refactoring.prefs.RefactoringPreferencesManager and net.sourceforge.squirrel_sql.plugins.exportconfig.ExportConfigPlugin do not have a common superclass |