IHTMLViewerPlugin plugin = null; try { IExtensionHandler handler = PluginManager.getInstance() .getExtensionHandler( IExtensionHandlerKeys.ORG_COLUMBA_CORE_HTMLVIEWER); IExtension extension = handler.getExtension(pluginId); if (extension == null) return null; plugin = (IHTMLViewerPlugin) extension.instanciateExtension(null); return plugin; } catch (PluginHandlerNotFoundException e) { LOG.severe("Error while loading viewer plugin: " + e.getMessage()); if (Logging.DEBUG) e.printStackTrace(); } catch (PluginException e) { LOG.severe("Error while loading viewer plugin: " + e.getMessage()); if (Logging.DEBUG) e.printStackTrace(); } return null;
IHTMLViewerPlugin plugin = null; try { IExtensionHandler handler = PluginManager.getInstance() .getExtensionHandler( IExtensionHandlerKeys.ORG_COLUMBA_CORE_HTMLVIEWER); IExtension extension = handler.getExtension(pluginId); if (extension == null) return null; plugin = (IHTMLViewerPlugin) extension.instanciateExtension(null); return plugin; } catch (PluginHandlerNotFoundException e) { LOG.severe("Error while loading viewer plugin: " + e.getMessage()); if (Logging.DEBUG) e.printStackTrace(); } catch (PluginException e) { LOG.severe("Error while loading viewer plugin: " + e.getMessage()); if (Logging.DEBUG) e.printStackTrace(); } return null;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/TextViewer.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/htmlviewer/HTMLViewerFactory.java
Method name: IHTMLViewerPlugin createHTMLViewerPluginInstance(String) Method name: IHTMLViewerPlugin createHTMLViewerPluginInstance(String)
Number of AST nodes: 9 Number of AST nodes: 9
1
IHTMLViewerPlugin plugin = null;
1
IHTMLViewerPlugin plugin = null;
2
		try {
2
		try {
3
			IExtensionHandler handler = PluginManager.getInstance()
3
			IExtensionHandler handler = PluginManager.getInstance()
4
					.getExtensionHandler(
4
					.getExtensionHandler(
5
							IExtensionHandlerKeys.ORG_COLUMBA_CORE_HTMLVIEWER);
5
							IExtensionHandlerKeys.ORG_COLUMBA_CORE_HTMLVIEWER);
6
			IExtension extension = handler.getExtension(pluginId);
6
			IExtension extension = handler.getExtension(pluginId);
7
			if (extension == null)
7
			if (extension == null)
8
				return null;
8
				return null;
9
			plugin = (IHTMLViewerPlugin) extension.instanciateExtension(null);
9
			plugin = (IHTMLViewerPlugin) extension.instanciateExtension(null);
10
			return plugin;
10
			return plugin;
11
		} catch (PluginHandlerNotFoundException e) {
11
		} catch (PluginHandlerNotFoundException e) {
12
			LOG.severe("Error while loading viewer plugin: " + e.getMessage());
12
			LOG.severe("Error while loading viewer plugin: " + e.getMessage());
13
			if (Logging.DEBUG)
13
			if (Logging.DEBUG)
14
				e.printStackTrace();
14
				e.printStackTrace();
15
		} catch (PluginException e) {
15
		} catch (PluginException e) {
16
			LOG.severe("Error while loading viewer plugin: " + e.getMessage());
16
			LOG.severe("Error while loading viewer plugin: " + e.getMessage());
17
			if (Logging.DEBUG)
17
			if (Logging.DEBUG)
18
				e.printStackTrace();
18
				e.printStackTrace();
19
		}
19
		}
20
		return null;
20
		return null;
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)1.1
Clones locationClones are in different classes
Number of node comparisons33
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.2
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    IHTMLViewerPlugin plugin = null;
    1
    IHTMLViewerPlugin plugin = null;
    2
    try
    2
    try
    3
    IExtensionHandler handler = PluginManager.getInstance().getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_CORE_HTMLVIEWER);
    3
    IExtensionHandler handler = PluginManager.getInstance().getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_CORE_HTMLVIEWER);
    4
    IExtension extension = handler.getExtension(pluginId);
    4
    IExtension extension = handler.getExtension(pluginId);
    5
    if (extension == null)
    5
    if (extension == null)
    6
    return null;
    6
    return null;
    7
    plugin = (IHTMLViewerPlugin)extension.instanciateExtension(null);
    7
    plugin = (IHTMLViewerPlugin)extension.instanciateExtension(null);
    8
    return plugin;
    8
    return plugin;
    9
    return null;
    9
    return null;
    Precondition Violations (0)
    Row Violation