You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2019/07/15 18:47:00 UTC
[jira] [Closed] (UIMA-5812) CPMEngine's getCasProcessors() messes
up the ae engines order
[ https://issues.apache.org/jira/browse/UIMA-5812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marshall Schor closed UIMA-5812.
--------------------------------
Resolution: Invalid
closing, no response from poster. If this is wrong, please re-open with more information.
> CPMEngine's getCasProcessors() messes up the ae engines order
> -------------------------------------------------------------
>
> Key: UIMA-5812
> URL: https://issues.apache.org/jira/browse/UIMA-5812
> Project: UIMA
> Issue Type: Bug
> Components: UIMA
> Affects Versions: 2.10.0SDK, 2.10.2SDK, 3.0.0SDK, 2.10.3SDK
> Environment: Ubuntu18.04, Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
> Reporter: Jianlin Shi
> Priority: Major
>
> In the current code:
> {quote} ArrayList aList = new ArrayList();
> Iterator keyIt = analysisEngines.keySet().iterator();
> while (keyIt.hasNext()) {
> String keyName = (String) keyIt.next();
> List kList = (List) analysisEngines.get(keyName);
> if (kList != null) {
> for (int i = 0; i < kList.size(); i++) {
> aList.add(kList.get(i));
> }
> }
> }
> keyIt = consumers.keySet().iterator();
> while (keyIt.hasNext()) {
> String keyName = (String) keyIt.next();
> List kList = (List) consumers.get(keyName);
> if (kList != null) {
> for (int i = 0; i < kList.size(); i++) {
> aList.add(kList.get(i));
> }
> }
> }
> {quote}
> While analysisEngines and consumers are both Hashtables, iterating through the keys won't preserve the order.
> Suggest to use the following instead:
> {quote} ArrayList aList = new ArrayList();
> for(Object annotator:this.annotatorDeployList){
> List kList = (List) annotator;
> if (kList != null) {
> for (int i = 0; i < kList.size(); i++) {
> aList.add(kList.get(i));
> }
> }
> }
> for(Object annotator:this.consumerDeployList){
> List kList = (List) annotator;
> if (kList != null) {
> for (int i = 0; i < kList.size(); i++) {
> aList.add(kList.get(i));
> }
> }
> }
> {quote}
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)