private static void loadPrefs() { try { XMLBeanReader doc = new XMLBeanReader(); File prefFile = PreferenceUtil.getPreferenceFileToReadFrom(plugin); doc.load(prefFile, RefactoringPreferenceBean.class.getClassLoader()); Iterator<?> it = doc.iterator(); if (it.hasNext()) { _prefs = (RefactoringPreferenceBean)it.next(); } } catch (FileNotFoundException ignore) { s_log.info(USER_PREFS_FILE_NAME + " not found - will be created"); } catch (Exception ex) { s_log.error("Error occured reading from preferences file: " + USER_PREFS_FILE_NAME, ex); } if (_prefs == null) { _prefs = new RefactoringPreferenceBean(); } _prefs.setClientName(Version.getApplicationName() + "/" + plugin.getDescriptiveName()); _prefs.setClientVersion(Version.getShortVersion() + "/" + plugin.getVersion());
private static void loadPrefs() { try { XMLBeanReader doc = new XMLBeanReader(); File prefFile = PreferenceUtil.getPreferenceFileToReadFrom(plugin); doc.load(prefFile, SQLScriptPreferenceBean.class.getClassLoader()); Iterator<?> it = doc.iterator(); if (it.hasNext()) { _prefs = (SQLScriptPreferenceBean)it.next(); } } catch (FileNotFoundException ignore) { s_log.info(USER_PREFS_FILE_NAME + " not found - will be created"); } catch (Exception ex) { s_log.error("Error occured reading from preferences file: " + USER_PREFS_FILE_NAME, ex); } if (_prefs == null) { _prefs = new SQLScriptPreferenceBean(); } _prefs.setClientName(Version.getApplicationName() + "/" + plugin.getDescriptiveName()); _prefs.setClientVersion(Version.getShortVersion() + "/" + plugin.getVersion());
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/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesManager.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
private static void loadPrefs() {
1
private static void loadPrefs() {
2
        try {
2
        try {
3
            XMLBeanReader doc = new XMLBeanReader();
3
            XMLBeanReader doc = new XMLBeanReader();
4
            
4
            
5
            File prefFile = PreferenceUtil.getPreferenceFileToReadFrom(plugin);
5
            File prefFile = PreferenceUtil.getPreferenceFileToReadFrom(plugin);
6
            
6
            
7
            doc.load(prefFile, RefactoringPreferenceBean.class.getClassLoader());            
7
            doc.load(prefFile, SQLScriptPreferenceBean.class.getClassLoader());            
8
            Iterator<?> it = doc.iterator();
8
            Iterator<?> it = doc.iterator();
9
            if (it.hasNext()) {
9
            if (it.hasNext()) {
10
                _prefs = (RefactoringPreferenceBean)it.next();
10
                _prefs = (SQLScriptPreferenceBean)it.next();
11
            }
11
            }
12
        } catch (FileNotFoundException ignore) {
12
        } catch (FileNotFoundException ignore) {
13
            s_log.info(USER_PREFS_FILE_NAME + " not found - will be created");
13
            s_log.info(USER_PREFS_FILE_NAME + " not found - will be created");
14
        } catch (Exception ex) {
14
        } catch (Exception ex) {
15
            s_log.error("Error occured reading from preferences file: "
15
            s_log.error("Error occured reading from preferences file: "
16
                    + USER_PREFS_FILE_NAME, ex);
16
                    + USER_PREFS_FILE_NAME, ex);
17
        }
17
        }
18
        if (_prefs == null) {
18
        if (_prefs == null) {
19
            _prefs = new RefactoringPreferenceBean();
19
            _prefs = new SQLScriptPreferenceBean();
20
        }
20
        }
21
        _prefs.setClientName(Version.getApplicationName() + "/" + plugin.getDescriptiveName());
21
        _prefs.setClientName(Version.getApplicationName() + "/" + plugin.getDescriptiveName());
22
        _prefs.setClientVersion(Version.getShortVersion() + "/" + plugin.getVersion());
22
        _prefs.setClientVersion(Version.getShortVersion() + "/" + plugin.getVersion());
23
    
23
    
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0