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

Setting feature on builtin JCas cover class that was loaded before initializing TypeSystemImpl fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.1SDK
    • 3.2.0SDK
    • uimaj
    • None
    • java 1.8.0-201

    Description

      The following Code (see attached proxy-red.zip)

      ProxyFactory f = new ProxyFactory();
      f.setTargetClass(JCas.class);
      f.getProxy();
      
      JCas jCas1 = JCasFactory.createJCas(new String[] {});
      jCas1.setDocumentText("test text"); // ==> ArrayIndexOutOfBoundsException
      
      

      is throwing the following exception (see attached exception.txt)

      java.lang.ArrayIndexOutOfBoundsException: -1
      at ....FeatureStructureImplC._setIntValueCommon(FeatureStructureImplC.java:1636)

      WORKAROUND (see attached proxy-green.zip)
      Creating a regular JCas before fix the problem  (without using the created JCas)

      JCasFactory.createJCas(new String[] {}); 
      
      ProxyFactory f = new ProxyFactory(); 
      f.setTargetClass(JCas.class); 
      f.getProxy(); 
      
      JCas jCas1 = JCasFactory.createJCas(new String[] {}); 
      jCas1.setDocumentText("test text"); // ==> No exception
      

       

      EASYMOCK
      The same problem occurs with EasyMock (see attached easymock.-red.zip and easymock-green.zip)

      Attachments

        1. Screenshot 2020-10-15 at 20.30.29.png
          189 kB
          Richard Eckart de Castilho
        2. Screenshot 2020-10-15 at 20.24.40.png
          292 kB
          Richard Eckart de Castilho
        3. proxy-red.zip
          12 kB
          Serge Démoulin
        4. proxy-green.zip
          12 kB
          Serge Démoulin
        5. exception.txt
          3 kB
          Serge Démoulin
        6. easymock-red.zip
          9 kB
          Serge Démoulin
        7. easymock-green.zip
          10 kB
          Serge Démoulin

        Issue Links

          Activity

            People

              rec Richard Eckart de Castilho
              serge712 Serge Démoulin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: