Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-5812

CPMEngine's getCasProcessors() messes up the ae engines order

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 2.10.0SDK, 2.10.2SDK, 3.0.0SDK, 2.10.3SDK
    • None
    • UIMA
    • None
    • Ubuntu18.04, Java(TM) SE Runtime Environment (build 1.8.0_151-b12)

    Description

      In the current code:

        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++)

      Unknown macro: {           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++)

            }
      }

      While analysisEngines and consumers are both Hashtables, iterating through the keys won't preserve the order.

      Suggest to use the following instead:

              ArrayList aList = new ArrayList();
              for(Object annotator:this.annotatorDeployList){
                  List kList = (List) annotator;
                  if (kList != null) {
                      for (int i = 0; i < kList.size(); i++)

      Unknown macro: {                     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++)

                  }
              }

      Attachments

        Activity

          People

            Unassigned Unassigned
            jianlins Jianlin Shi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: