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

SolrCASConsumers initialize method should be refactored

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.3.1Addons
    • Sandbox
    • None

    Description

      In the initialize method the following is done:

      String solrInstanceTypeParam = String.valueOf(context.getConfigParameterValue("solrInstanceType"));
      assert solrInstanceTypeParam != null;

      The assert will always be true since String.valueOf never returns a null reference, even when
      you pass a null reference to it, it will return the string "null".

      getConfigParameterValue can actually return null, and we should fail the initialization if
      not all necessary parameters to run it are specified in the descriptor. It should fail
      with a meaningful error message.
      Using assert is not a safe way to fail the initialization because asserts are usually
      disabled.

      Attachments

        Activity

          People

            Unassigned Unassigned
            joern Jörn Kottmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: