You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2018/08/01 22:58:39 UTC
[uima-uimafit] branch
feature/UIMA-2903-List-resources-in-a-ResourceManager-v3 created (now
6d2c712)
This is an automated email from the ASF dual-hosted git repository.
rec pushed a change to branch feature/UIMA-2903-List-resources-in-a-ResourceManager-v3
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git.
at 6d2c712 [UIMA-2903] List resources in a ResourceManager / remove hack in uimaFIT
This branch includes the following new commits:
new 6d2c712 [UIMA-2903] List resources in a ResourceManager / remove hack in uimaFIT
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[uima-uimafit] 01/01: [UIMA-2903] List resources in a
ResourceManager / remove hack in uimaFIT
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rec pushed a commit to branch feature/UIMA-2903-List-resources-in-a-ResourceManager-v3
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git
commit 6d2c712aa8260e7602271ea64df187022d111dd5
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Thu Aug 2 00:57:33 2018 +0200
[UIMA-2903] List resources in a ResourceManager / remove hack in uimaFIT
- Finally remove the hack in uimaFIT
---
.../initialize/ExternalResourceInitializer.java | 28 +---------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/uimafit-core/src/main/java/org/apache/uima/fit/component/initialize/ExternalResourceInitializer.java b/uimafit-core/src/main/java/org/apache/uima/fit/component/initialize/ExternalResourceInitializer.java
index 2607cc3..ba0e4f0 100644
--- a/uimafit-core/src/main/java/org/apache/uima/fit/component/initialize/ExternalResourceInitializer.java
+++ b/uimafit-core/src/main/java/org/apache/uima/fit/component/initialize/ExternalResourceInitializer.java
@@ -226,32 +226,6 @@ public final class ExternalResourceInitializer {
+ resMgr.getClass() + "]");
}
- // UIMA-2903 - List resources in a ResourceManager / remove hack in uimaFIT
- // This is how we do it after upgrading to UIMA 2.10.0
- // return resMgr.getExternalResources();
-
- // For UIMA 2.9.0 and before, we need to do this
- Field resourceMapField = null;
- try {
- // Fetch the list of resources
- resourceMapField = ReflectionUtil.getField(resMgr, "mResourceMap");
- resourceMapField.setAccessible(true);
- @SuppressWarnings("unchecked")
- Map<String, Object> resources = (Map<String, Object>) resourceMapField.get(resMgr);
-
- return resources.values();
- } catch (SecurityException e) {
- throw new ResourceInitializationException(e);
- } catch (NoSuchFieldException e) {
- throw new ResourceInitializationException(e);
- } catch (IllegalArgumentException e) {
- throw new ResourceInitializationException(e);
- } catch (IllegalAccessException e) {
- throw new ResourceInitializationException(e);
- } finally {
- if (resourceMapField != null) {
- resourceMapField.setAccessible(false);
- }
- }
+ return resMgr.getExternalResources();
}
}