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

class cast exception in CasAnnotationViewer

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0SDK
    • Fix Version/s: 2.8.1SDK
    • Component/s: Tools
    • Labels:
      None

      Description

      The CasAnnotationViewer has a long-standing issue - it doesn't properly handle the displaying features which are built-in arrays (except FSArray), if the CAS being viewed is a JCas style Cas - a class cast exception happens. This problem predates the changes introduced in UIMA-3374, but is present there too. Prior to UIMA-3374, the CasAnnotationViewer did not activate the JCas, and the DocumentAnalyzer (a main caller of this viewer) always passed in a non-JCas CAS, so things worked.

      The changes in UIMA-3374 activated the JCas (it did a cas.getJCas()), and this exposed these previously present errors which generate class cast exceptions. These errors are caused by code that presumed a non-JCas style of CAS, and did casts that depended on this. One instance of this is the line

      StringArrayFSImpl arrayFS = (StringArrayFSImpl) aFS.getFeatureValue(feature);
      

      which generates a cast exception if the JCas is being used.

      Scan the code to find any other instances of an assumption being made of the kind of cover class.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                schor Marshall Schor
                Reporter:
                schor Marshall Schor
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: