super(); XMLObjectCache cache = plugin.getSettingsCache(); Iterator<?> it = cache.getAllForClass(OyoahaPreferences.class); if (it.hasNext()) { _prefs = (OyoahaPreferences)it.next(); } else { _prefs = new OyoahaPreferences(); try { cache.add(_prefs); } catch (DuplicateObjectException ex) { s_log.error("OyoahaPreferences object already in XMLObjectCache", ex); } } // Folder that stores themepacks for this LAF. File themePackDir = new File(plugin.getPluginAppSettingsFolder(), "oyoaha-theme-packs"); _prefs.setThemePackDirectory(themePackDir.getAbsolutePath()); if (!themePackDir.exists()) { themePackDir.mkdirs(); }
super(); XMLObjectCache cache = plugin.getSettingsCache(); Iterator<?> it = cache.getAllForClass(SkinPreferences.class); if (it.hasNext()) { _prefs = (SkinPreferences)it.next(); } else { _prefs = new SkinPreferences(); try { cache.add(_prefs); } catch (DuplicateObjectException ex) { s_log.error("SkinPreferences object already in XMLObjectCache", ex); } } // Folder that stores themepacks for this LAF. File themePackDir = new File(plugin.getPluginAppSettingsFolder(), "skinlf-theme-packs"); _prefs.setThemePackDirectory(themePackDir.getAbsolutePath()); if (!themePackDir.exists()) { themePackDir.mkdirs(); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/laf/src/net/sourceforge/squirrel_sql/plugins/laf/OyoahaLookAndFeelController.java File path: /sql12/plugins/laf/src/net/sourceforge/squirrel_sql/plugins/laf/SkinLookAndFeelController.java
Method name: void OyoahaLookAndFeelController(LAFPlugin) Method name: void SkinLookAndFeelController(LAFPlugin)
Number of AST nodes: 12 Number of AST nodes: 12
1
super();
1
super();
2
		XMLObjectCache cache = plugin.getSettingsCache();
2
		XMLObjectCache cache = plugin.getSettingsCache();
3
		Iterator<?> it = cache.getAllForClass(OyoahaPreferences.class);
3
		Iterator<?> it = cache.getAllForClass(SkinPreferences.class);
4
		if (it.hasNext())
4
		if (it.hasNext())
5
		{
5
		{
6
			_prefs = (OyoahaPreferences)it.next();
6
			_prefs = (SkinPreferences)it.next();
7
		}
7
		}
8
		else
8
		else
9
		{
9
		{
10
			_prefs = new OyoahaPreferences();
10
			_prefs = new SkinPreferences();
11
			try
11
			try
12
			{
12
			{
13
				cache.add(_prefs);
13
				cache.add(_prefs);
14
			}
14
			}
15
			catch (DuplicateObjectException ex)
15
			catch (DuplicateObjectException ex)
16
			{
16
			{
17
				s_log.error("OyoahaPreferences object already in XMLObjectCache", ex);
17
				s_log.error("SkinPreferences object already in XMLObjectCache", ex);
18
			}
18
			}
19
		}
19
		}
20
		// Folder that stores themepacks for this LAF.
20
		// Folder that stores themepacks for this LAF.
21
		File themePackDir = new File(plugin.getPluginAppSettingsFolder(), "oyoaha-theme-packs");
21
		File themePackDir = new File(plugin.getPluginAppSettingsFolder(), "skinlf-theme-packs");
22
		_prefs.setThemePackDirectory(themePackDir.getAbsolutePath());
22
		_prefs.setThemePackDirectory(themePackDir.getAbsolutePath());
23
		if (!themePackDir.exists())
23
		if (!themePackDir.exists())
24
		{
24
		{
25
			themePackDir.mkdirs();
25
			themePackDir.mkdirs();
26
		}
26
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.8
Clones locationClones are in different classes having the same super class
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    super();
    1
    super();
    1
    super();
    Preondition Violations
    Super constructor call super(); cannot be extracted from constructor
    Super constructor call super(); cannot be extracted from constructor
    1
    super();
    2
    XMLObjectCache cache = plugin.getSettingsCache();
    2
    XMLObjectCache cache = plugin.getSettingsCache();
    3
    Iterator<?> it = cache.getAllForClass(OyoahaPreferences.class);
    3
    Iterator<?> it = cache.getAllForClass(OyoahaPreferences.class);
    3
    Iterator<?> it = cache.getAllForClass(SkinPreferences.class);
    Differences
    Expression1Expression2Difference
    OyoahaPreferences.classSkinPreferences.classLITERAL_VALUE_MISMATCH
    3
    Iterator<?> it = cache.getAllForClass(SkinPreferences.class);
    4
    if (it.hasNext())
    4
    if (it.hasNext())
    5
    _prefs = (OyoahaPreferences)it.next();
    5
    _prefs = (OyoahaPreferences)it.next();
    5
    _prefs = (SkinPreferences)it.next();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.laf.OyoahaLookAndFeelController.OyoahaPreferencesnet.sourceforge.squirrel_sql.plugins.laf.SkinLookAndFeelController.SkinPreferencesSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.laf.OyoahaLookAndFeelController.OyoahaPreferencesnet.sourceforge.squirrel_sql.plugins.laf.SkinLookAndFeelController.SkinPreferencesSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (OyoahaPreferences)it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (SkinPreferences)it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    _prefs = (SkinPreferences)it.next();
    else
    else
    6
    _prefs = new OyoahaPreferences();
    6
    _prefs = new OyoahaPreferences();
    6
    _prefs = new SkinPreferences();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.laf.OyoahaLookAndFeelController.OyoahaPreferencesnet.sourceforge.squirrel_sql.plugins.laf.SkinLookAndFeelController.SkinPreferencesSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.laf.OyoahaLookAndFeelController.OyoahaPreferencesnet.sourceforge.squirrel_sql.plugins.laf.SkinLookAndFeelController.SkinPreferencesSUBCLASS_TYPE_MISMATCH
    6
    _prefs = new SkinPreferences();
    7
    try
    7
    try
    7
    try
    Differences
    Expression1Expression2Difference
    "OyoahaPreferences object already in XMLObjectCache""SkinPreferences object already in XMLObjectCache"LITERAL_VALUE_MISMATCH
    7
    try
    8
    cache.add(_prefs);
    8
    cache.add(_prefs);
    8
    cache.add(_prefs);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.laf.OyoahaLookAndFeelController.OyoahaPreferencesnet.sourceforge.squirrel_sql.plugins.laf.SkinLookAndFeelController.SkinPreferencesSUBCLASS_TYPE_MISMATCH
    8
    cache.add(_prefs);
    9
    File themePackDir = new File(plugin.getPluginAppSettingsFolder(), "oyoaha-theme-packs");
    9
    File themePackDir = new File(plugin.getPluginAppSettingsFolder(), "oyoaha-theme-packs");
    9
    File themePackDir = new File(plugin.getPluginAppSettingsFolder(), "skinlf-theme-packs");
    Differences
    Expression1Expression2Difference
    "oyoaha-theme-packs""skinlf-theme-packs"LITERAL_VALUE_MISMATCH
    9
    File themePackDir = new File(plugin.getPluginAppSettingsFolder(), "skinlf-theme-packs");
    10
    _prefs.setThemePackDirectory(themePackDir.getAbsolutePath());
    10
    _prefs.setThemePackDirectory(themePackDir.getAbsolutePath());
    10
    _prefs.setThemePackDirectory(themePackDir.getAbsolutePath());
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.laf.OyoahaLookAndFeelController.OyoahaPreferencesnet.sourceforge.squirrel_sql.plugins.laf.SkinLookAndFeelController.SkinPreferencesSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression _prefs cannot be unified with expression _prefs , because common superclass net.sourceforge.squirrel_sql.fw.id.IHasIdentifier does not declare member(s) public void setThemePackDirectory(java.lang.String)
    10
    _prefs.setThemePackDirectory(themePackDir.getAbsolutePath());
    11
    if (!themePackDir.exists())
    11
    if (!themePackDir.exists())
    12
    themePackDir.mkdirs();
    12
    themePackDir.mkdirs();
    Precondition Violations (5)
    Row Violation
    1Super constructor call super(); cannot be extracted from constructor
    2Super constructor call super(); cannot be extracted from constructor
    3Expression (OyoahaPreferences)it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression (SkinPreferences)it.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression _prefs cannot be unified with expression _prefs , because common superclass net.sourceforge.squirrel_sql.fw.id.IHasIdentifier does not declare member(s) public void setThemePackDirectory(java.lang.String)