_currentThemePrefs = new MetalThemePreferences(); ClassLoader cl = getLAFRegister().getLookAndFeelClassLoader(); Class<?> clazz = Class.forName(MetalLookAndFeelController.DEFAULT_METAL_THEME, false, cl); MetalTheme theme = (MetalTheme) clazz.newInstance(); _currentThemePrefs.setThemeName(theme.getName()); try { cache.add(_currentThemePrefs); } catch (DuplicateObjectException ex) { s_log.error("MetalThemePreferences object already in XMLObjectCache", ex); }
_prefs = new PlasticThemePreferences(); ClassLoader cl = getLAFRegister().getLookAndFeelClassLoader(); Class<?> clazz = Class.forName(AbstractPlasticController.DEFAULT_PLASTIC_THEME_CLASS_NAME, false, cl); MetalTheme theme = (MetalTheme) clazz.newInstance(); _prefs.setThemeName(theme.getName()); try { cache.add(_prefs); } catch (DuplicateObjectException ex) { s_log.error("PlasticThemePreferences object already in XMLObjectCache", ex); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/laf/src/net/sourceforge/squirrel_sql/plugins/laf/MetalLookAndFeelController.java File path: /sql12/plugins/laf/src/net/sourceforge/squirrel_sql/plugins/laf/PlasticLookAndFeelController.java
Method name: void MetalLookAndFeelController(LAFPlugin, LAFRegister) Method name: void PlasticLookAndFeelController(LAFPlugin, LAFRegister)
Number of AST nodes: 7 Number of AST nodes: 7
1
_currentThemePrefs = new MetalThemePreferences();
1
_prefs = new PlasticThemePreferences();
2
            ClassLoader cl = getLAFRegister().getLookAndFeelClassLoader();
2
            ClassLoader cl = getLAFRegister().getLookAndFeelClassLoader();
3
            Class<?> clazz = Class.forName(MetalLookAndFeelController.DEFAULT_METAL_THEME, false, cl);
3
            Class<?> clazz = Class.forName(AbstractPlasticController.DEFAULT_PLASTIC_THEME_CLASS_NAME, false, cl);
4
            MetalTheme theme = (MetalTheme) clazz.newInstance();
4
            MetalTheme theme = (MetalTheme) clazz.newInstance();
5
            _currentThemePrefs.setThemeName(theme.getName());
5
            _prefs.setThemeName(theme.getName());
6
            try
6
            try
7
            {
7
            {
8
               cache.add(_currentThemePrefs);
8
               cache.add(_prefs);
9
            }
9
            }
10
            catch (DuplicateObjectException ex)
10
            catch (DuplicateObjectException ex)
11
            {
11
            {
12
               s_log.error("MetalThemePreferences object already in XMLObjectCache", ex);
12
               s_log.error("PlasticThemePreferences object already in XMLObjectCache", ex);
13
            }
13
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in different classes having the same super class
Number of node comparisons22
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)115.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    _currentThemePrefs = new MetalThemePreferences();
    9
    _currentThemePrefs = new MetalThemePreferences();
    7
    _prefs = new PlasticThemePreferences();
    Differences
    Expression1Expression2Difference
    _currentThemePrefs_prefsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.laf.MetalLookAndFeelController.MetalThemePreferencesnet.sourceforge.squirrel_sql.plugins.laf.PlasticLookAndFeelController.PlasticThemePreferencesSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.laf.MetalLookAndFeelController.MetalThemePreferencesnet.sourceforge.squirrel_sql.plugins.laf.PlasticLookAndFeelController.PlasticThemePreferencesSUBCLASS_TYPE_MISMATCH
    7
    _prefs = new PlasticThemePreferences();
    10
    ClassLoader cl = getLAFRegister().getLookAndFeelClassLoader();
    8
    ClassLoader cl = getLAFRegister().getLookAndFeelClassLoader();
    11
    Class<?> clazz = Class.forName(MetalLookAndFeelController.DEFAULT_METAL_THEME, false, cl);
    11
    Class<?> clazz = Class.forName(MetalLookAndFeelController.DEFAULT_METAL_THEME, false, cl);
    9
    Class<?> clazz = Class.forName(AbstractPlasticController.DEFAULT_PLASTIC_THEME_CLASS_NAME, false, cl);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.laf.MetalLookAndFeelControllernet.sourceforge.squirrel_sql.plugins.laf.AbstractPlasticControllerSUBCLASS_TYPE_MISMATCH
    DEFAULT_METAL_THEMEDEFAULT_PLASTIC_THEME_CLASS_NAMEVARIABLE_NAME_MISMATCH
    9
    Class<?> clazz = Class.forName(AbstractPlasticController.DEFAULT_PLASTIC_THEME_CLASS_NAME, false, cl);
    12
    MetalTheme theme = (MetalTheme)clazz.newInstance();
    10
    MetalTheme theme = (MetalTheme)clazz.newInstance();
    13
    _currentThemePrefs.setThemeName(theme.getName());
    13
    _currentThemePrefs.setThemeName(theme.getName());
    11
    _prefs.setThemeName(theme.getName());
    Differences
    Expression1Expression2Difference
    _currentThemePrefs_prefsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.laf.MetalLookAndFeelController.MetalThemePreferencesnet.sourceforge.squirrel_sql.plugins.laf.PlasticLookAndFeelController.PlasticThemePreferencesSUBCLASS_TYPE_MISMATCH
    11
    _prefs.setThemeName(theme.getName());
    14
    try
    14
    try
    12
    try
    Differences
    Expression1Expression2Difference
    "MetalThemePreferences object already in XMLObjectCache""PlasticThemePreferences object already in XMLObjectCache"LITERAL_VALUE_MISMATCH
    12
    try
    15
    cache.add(_currentThemePrefs);
    15
    cache.add(_currentThemePrefs);
    13
    cache.add(_prefs);
    Differences
    Expression1Expression2Difference
    _currentThemePrefs_prefsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.laf.MetalLookAndFeelController.MetalThemePreferencesnet.sourceforge.squirrel_sql.plugins.laf.PlasticLookAndFeelController.PlasticThemePreferencesSUBCLASS_TYPE_MISMATCH
    13
    cache.add(_prefs);
    Precondition Violations (0)
    Row Violation