CloneSet33


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
77320.986type_declarations
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
17735
E:/TSE/Projects-CloneDR/sql12/plugins/mssql/src/net/sourceforge/squirrel_sql/plugins/mssql/prefs/PreferencesManager.java
27735
E:/TSE/Projects-CloneDR/sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/prefs/RefactoringPreferencesManager.java
37735
E:/TSE/Projects-CloneDR/sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesManager.java
Next
Last
Clone Instance
1
Line Count
77
Source Line
35
Source File
E:/TSE/Projects-CloneDR/sql12/plugins/mssql/src/net/sourceforge/squirrel_sql/plugins/mssql/prefs/PreferencesManager.java

public class PreferencesManager {
  /** Logger for this class. */
  private final static ILogger s_log = LoggerController.createLogger(PreferencesManager.class );

  /** Name of preferences file. */
  private static final String USER_PREFS_FILE_NAME = "prefs.xml";

  /** Folder to store user settings in. */
  private static File _userSettingsFolder;

  private static MSSQLPreferenceBean _prefs = null;

  private static IPlugin plugin = null;

  public static void initialize(IPlugin thePlugin) throws PluginException {
    plugin = thePlugin;
    // Folder to store user settings.
    try {
      _userSettingsFolder = plugin.getPluginUserSettingsFolder();
    }
    catch (IOException
           ex) {
      throw new PluginException(ex);
    }
    loadPrefs();
  }

  public static MSSQLPreferenceBean getPreferences() {
    return _prefs;
  }

  public static void unload() {
    savePrefs();
  }

  /**
   * Save preferences to disk.
   */
  public static void savePrefs() {
    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);
    }
  }

  /**
   * Load from preferences file.
   */
  private static void loadPrefs() {
    try {
      XMLBeanReader doc = new XMLBeanReader();
      File prefFile = PreferenceUtil.getPreferenceFileToReadFrom(plugin);
      doc.load(prefFile, MSSQLPreferenceBean.class .getClassLoader());
      Iterator<? > it = doc.iterator();
      if (it.hasNext()) {
        _prefs = (MSSQLPreferenceBean) 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 MSSQLPreferenceBean();
    }
    _prefs.setClientName(Version.getApplicationName() + "/" + plugin.getDescriptiveName());
    _prefs.setClientVersion(Version.getShortVersion() + "/" + plugin.getVersion());
  }
}




Next
Previous
Clone Instance
2
Line Count
77
Source Line
35
Source File
E:/TSE/Projects-CloneDR/sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/prefs/RefactoringPreferencesManager.java

public class RefactoringPreferencesManager {
  /** Logger for this class. */
  private final static ILogger s_log = LoggerController.createLogger(RefactoringPreferencesManager.class );

  /** Name of preferences file. */
  private static final String USER_PREFS_FILE_NAME = "prefs.xml";

  /** Folder to store user settings in. */
  private static File _userSettingsFolder;

  private static RefactoringPreferenceBean _prefs = null;

  private static IPlugin plugin = null;

  public static void initialize(IPlugin thePlugin) throws PluginException {
    plugin = thePlugin;
    // Folder to store user settings.
    try {
      _userSettingsFolder = plugin.getPluginUserSettingsFolder();
    }
    catch (IOException
           ex) {
      throw new PluginException(ex);
    }
    loadPrefs();
  }

  public static RefactoringPreferenceBean getPreferences() {
    return _prefs;
  }

  public static void unload() {
    savePrefs();
  }

  /**
   * Save preferences to disk.
   */
  public static void savePrefs() {
    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);
    }
  }

  /**
   * Load from preferences file.
   */
  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());
  }
}




First
Previous
Clone Instance
3
Line Count
77
Source Line
35
Source File
E:/TSE/Projects-CloneDR/sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesManager.java

public class SQLScriptPreferencesManager {
  /** Logger for this class. */
  private final static ILogger s_log = LoggerController.createLogger(SQLScriptPreferencesManager.class );

  /** Name of preferences file. */
  private static final String USER_PREFS_FILE_NAME = "prefs.xml";

  /** Folder to store user settings in. */
  private static File _userSettingsFolder;

  private static SQLScriptPreferenceBean _prefs = null;

  private static IPlugin plugin = null;

  public static void initialize(IPlugin thePlugin) throws PluginException {
    plugin = thePlugin;
    // Folder to store user settings.
    try {
      _userSettingsFolder = plugin.getPluginUserSettingsFolder();
    }
    catch (IOException
           ex) {
      throw new PluginException(ex);
    }
    loadPrefs();
  }

  public static SQLScriptPreferenceBean getPreferences() {
    return _prefs;
  }

  public static void unload() {
    savePrefs();
  }

  /**
   * Save preferences to disk.
   */
  public static void savePrefs() {
    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);
    }
  }

  /**
   * Load from preferences file.
   */
  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 AbstractionParameter Count: 2Parameter Bindings

public class [[#variable18c39800]]{
  /** Logger for this class. */
  private final static ILogger s_log = LoggerController.createLogger( [[#variable18c39800]].class );

  /** Name of preferences file. */
  private static final String USER_PREFS_FILE_NAME = "prefs.xml";

  /** Folder to store user settings in. */
  private static File _userSettingsFolder;

  private static [[#variable18c39700]] _prefs = null;

  private static IPlugin plugin = null;

  public static void initialize(IPlugin thePlugin) throws PluginException {
    plugin = thePlugin;
    // Folder to store user settings.
    try {
      _userSettingsFolder = plugin.getPluginUserSettingsFolder();
    }
    catch (IOException
           ex) {
      throw new PluginException(ex);
    }
    loadPrefs();
  }

  public static [[#variable18c39700]] getPreferences() {
    return _prefs;
  }

  public static void unload() {
    savePrefs();
  }

  /**
       * Save preferences to disk.
       */
  public static void savePrefs() {
    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);
    }
  }

  /**
       * Load from preferences file.
       */
  private static void loadPrefs() {
    try {
      XMLBeanReader doc = new XMLBeanReader();
      File prefFile = PreferenceUtil.getPreferenceFileToReadFrom(plugin);
      doc.load(prefFile,  [[#variable18c39700]].class .getClassLoader());
      Iterator<? > it = doc.iterator();
      if (it.hasNext()) {
        _prefs = ( [[#variable18c39700]]) 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 [[#variable18c39700]]();
    }
    _prefs.setClientName(Version.getApplicationName() + "/" + plugin.getDescriptiveName());
    _prefs.setClientVersion(Version.getShortVersion() + "/" + plugin.getVersion());
  }
}


 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#18c39800]]
PreferencesManager 
12[[#18c39800]]
RefactoringPreferencesManager 
13[[#18c39800]]
SQLScriptPreferencesManager 
21[[#18c39700]]
MSSQLPreferenceBean 
22[[#18c39700]]
RefactoringPreferenceBean 
23[[#18c39700]]
SQLScriptPreferenceBean