uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marshall Schor (Jira)" <...@uima.apache.org>
Subject [jira] [Commented] (UIMA-6247) Ruta: not able to check label expression on null as implicit condition
Date Sun, 21 Jun 2020 14:31:00 GMT

    [ https://issues.apache.org/jira/browse/UIMA-6247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17141501#comment-17141501
] 

Marshall Schor commented on UIMA-6247:
--------------------------------------

Running this gave errors on all 3 test cases:

Caused by: org.apache.uima.cas.CASRuntimeException: The JCAS cover class "org.apache.uima.cas.test.Token_Type"
could not be loaded. at 

Caused by: java.lang.ClassCastException: org.apache.uima.jcas.tcas.Annotation cannot be cast
to org.apache.uima.cas.test.Token at 

Caused by: java.lang.ClassCastException: org.apache.uima.jcas.tcas.Annotation cannot be cast
to org.apache.uima.cas.test.Token at 

 

Fixing the likely little typo bug in IsolatingClassLoader redefining(...), to add the pattern
to "redefineClassesPatterns", makes 2 of the tests pass, and the one that fails now fails
with:

Caused by: java.lang.ClassCastException: org.apache.uima.cas.test.Token cannot be cast to
org.apache.uima.cas.test.Token at

 

Looking at this code, it is attempting to cast to the Token class, which is being loaded by
the class loader that loaded the JCasClassLoaderTest code itself, which I'm guessing is different
from the test's version of that class which was probably loaded with the IsolatingClassLoader
(I haven't traced the code, so this is just an educated guess).  This of course would cause
a class cast exception.

 

Perhaps the test needs to a) not do a class cast, b) do instead a test to see if the object
is the expected class, using some test for example, from the "Class" class: isAssignableFrom
or isInstance, and not use any reference to "Token" in the testcase as a class itself.

WDYT?

> Ruta: not able to check label expression on null as implicit condition
> ----------------------------------------------------------------------
>
>                 Key: UIMA-6247
>                 URL: https://issues.apache.org/jira/browse/UIMA-6247
>             Project: UIMA
>          Issue Type: Bug
>          Components: Ruta
>            Reporter: Peter Klügl
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message