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 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 22 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 6.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | IExtensionHandler handler = PluginManager.getInstance().getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_CORE_CONTEXT_PROVIDER); |
| 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]); | |||||||||||||||||||
9 | IContextProvider provider = (IContextProvider)extension.instanciateExtension(null); |
| 8 | ISearchProvider provider = (ISearchProvider)extension.instanciateExtension(null); | ||||||||||||||||||
|
| 9 | searchManager.registerProvider(provider); | |||||||||||||||||||
10 | contextSearchManager.register(provider); |
| |
Row | Violation |
---|---|
1 | Expression (IContextProvider)extension.instanciateExtension(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression (ISearchProvider)extension.instanciateExtension(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | 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 |
4 | 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 |