IExtensionHandler handler = PluginManager .getInstance() .getExtensionHandler( IExtensionHandlerKeys.ORG_COLUMBA_CORE_CONTEXT_PROVIDER); String[] ids = handler.getPluginIdList(); for (int i = 0; i < ids.length; i++) { try { IExtension extension = handler.getExtension(ids[i]); IContextProvider provider = (IContextProvider) extension .instanciateExtension(null); contextSearchManager.register(provider); } catch (PluginException e) { LOG.severe("Error while loading plugin: " + e.getMessage()); if (Logging.DEBUG) e.printStackTrace(); } }
IExtensionHandler handler = PluginManager.getInstance() .getExtensionHandler( IExtensionHandlerKeys.ORG_COLUMBA_CORE_SEARCH); String[] ids = handler.getPluginIdList(); for (int i = 0; i < ids.length; i++) { try { IExtension extension = handler.getExtension(ids[i]); ISearchProvider provider = (ISearchProvider) extension .instanciateExtension(null); searchManager.registerProvider(provider); } catch (PluginException e) { LOG.severe("Error while loading plugin: " + e.getMessage()); if (Logging.DEBUG) e.printStackTrace(); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/search/SearchPanel.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/search/SearchPanel.java
Method name: void initContextProvider() Method name: void initSearchProvider()
Number of AST nodes: 7 Number of AST nodes: 7
1
IExtensionHandler handler = PluginManager
1
IExtensionHandler handler = PluginManager
2
					.getInstance()
2
.getInstance()
3
					.getExtensionHandler(
3
					.getExtensionHandler(
4
							IExtensionHandlerKeys.ORG_COLUMBA_CORE_CONTEXT_PROVIDER);
4
							IExtensionHandlerKeys.ORG_COLUMBA_CORE_SEARCH);
5
			String[] ids = handler.getPluginIdList();
5
			String[] ids = handler.getPluginIdList();
6
			for (int i = 0; i < ids.length; i++) {
6
			for (int i = 0; i < ids.length; i++) {
7
				try {
7
				try {
8
					IExtension extension = handler.getExtension(ids[i]);
8
					IExtension extension = handler.getExtension(ids[i]);
9
					IContextProvider provider = (IContextProvider) extension
9
					ISearchProvider provider = (ISearchProvider) extension
10
							.instanciateExtension(null);
10
							.instanciateExtension(null);
11
					contextSearchManager.register(provider);
11
					searchManager.registerProvider(provider);
12
				} catch (PluginException e) {
12
				} catch (PluginException e) {
13
					LOG.severe("Error while loading plugin: " + e.getMessage());
13
					LOG.severe("Error while loading plugin: " + e.getMessage());
14
					if (Logging.DEBUG)
14
					if (Logging.DEBUG)
15
						e.printStackTrace();
15
						e.printStackTrace();
16
				}
16
				}
17
			}
17
			}
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 declared in the same class
Number of node comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    IExtensionHandler handler = PluginManager.getInstance().getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_CORE_CONTEXT_PROVIDER);
    4
    IExtensionHandler handler = PluginManager.getInstance().getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_CORE_CONTEXT_PROVIDER);
    3
    IExtensionHandler handler = PluginManager.getInstance().getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_CORE_SEARCH);
    Differences
    Expression1Expression2Difference
    ORG_COLUMBA_CORE_CONTEXT_PROVIDERORG_COLUMBA_CORE_SEARCHVARIABLE_NAME_MISMATCH
    3
    IExtensionHandler handler = PluginManager.getInstance().getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_CORE_SEARCH);
    5
    String[] ids = handler.getPluginIdList();
    4
    String[] ids = handler.getPluginIdList();
    6
    for (int i = 0; i < ids.length; i++)
    5
    for (int i = 0; i < ids.length; i++)
    7
    try
    6
    try
    8
    IExtension extension = handler.getExtension(ids[i]);
    7
    IExtension extension = handler.getExtension(ids[i]);
                                                                                                                                                                        
    8
    ISearchProvider provider = (ISearchProvider)extension.instanciateExtension(null);
    Preondition Violations
    Unmatched statement ISearchProvider provider=(ISearchProvider)extension.instanciateExtension(null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement ISearchProvider provider=(ISearchProvider)extension.instanciateExtension(null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    8
    ISearchProvider provider = (ISearchProvider)extension.instanciateExtension(null);
                                                                                            
    9
    searchManager.registerProvider(provider);
    Preondition Violations
    Unmatched statement searchManager.registerProvider(provider); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    searchManager.registerProvider(provider);
    9
    IContextProvider provider = (IContextProvider)extension.instanciateExtension(null);
    9
    IContextProvider provider = (IContextProvider)extension.instanciateExtension(null);
    Preondition Violations
    Unmatched statement IContextProvider provider=(IContextProvider)extension.instanciateExtension(null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement IContextProvider provider=(IContextProvider)extension.instanciateExtension(null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                                                                            
    10
    contextSearchManager.register(provider);
    10
    contextSearchManager.register(provider);
    Preondition Violations
    Unmatched statement contextSearchManager.register(provider); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                            
    Precondition Violations (6)
    Row Violation
    1Unmatched statement ISearchProvider provider=(ISearchProvider)extension.instanciateExtension(null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement ISearchProvider provider=(ISearchProvider)extension.instanciateExtension(null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3Unmatched statement searchManager.registerProvider(provider); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement IContextProvider provider=(IContextProvider)extension.instanciateExtension(null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement IContextProvider provider=(IContextProvider)extension.instanciateExtension(null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6Unmatched statement contextSearchManager.register(provider); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted