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

Differentiate no Annotation and multiple Annotation case in CasUtil.selectSingle(CAS cas, Type type)

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Trivial
    • Resolution: Won't Fix
    • 2.0.0uimaFIT
    • None
    • uimaFIT
    • None

    Description

      Currently there is one exception type in CasUtil.selectSingle(CAS cas, Type type) method for the case if CAS does not contain an Annotation or CAS contains more than one Annotation. However, I sometimes need to differentiate between these two cases in exception handling. A new method like, selectSingleOrNull(...) could solve this problem: return null if no Annotation, RuntimeException if multiple Annotations.

      Currently to handle this problem I just use CasUtil.select(...) and check for the size of the returned collection.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              _smartfun Artem
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified