You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2021/03/24 11:01:57 UTC

[uima-ruta] 01/01: [UIMA-6345] RutaBasicUtils should not require RutaBasic type

This is an automated email from the ASF dual-hosted git repository.

pkluegl pushed a commit to branch bugfix/UIMA-6345-RutaBasicUtils-should-not-require-RutaBasic-type
in repository https://gitbox.apache.org/repos/asf/uima-ruta.git

commit d49c0c445b6a5e24001ed9580682a2e68b752cb4
Author: Peter Klügl <pe...@averbis.com>
AuthorDate: Wed Mar 24 12:01:42 2021 +0100

    [UIMA-6345] RutaBasicUtils should not require RutaBasic type
    
    - check on type
---
 .../src/main/java/org/apache/uima/ruta/RutaBasicUtils.java     | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/RutaBasicUtils.java b/ruta-core/src/main/java/org/apache/uima/ruta/RutaBasicUtils.java
index f371d49..473f75d 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/RutaBasicUtils.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/RutaBasicUtils.java
@@ -62,6 +62,11 @@ public class RutaBasicUtils {
     CAS cas = annotation.getCAS();
     TypeSystem typeSystem = cas.getTypeSystem();
     Type basicType = typeSystem.getType(RutaBasic.class.getName());
+
+    if (basicType == null) {
+      return false;
+    }
+
     Type type = annotation.getType();
 
     if (typeSystem.subsumes(basicType, type)) {
@@ -107,6 +112,11 @@ public class RutaBasicUtils {
     CAS cas = annotation.getCAS();
     TypeSystem typeSystem = cas.getTypeSystem();
     Type basicType = typeSystem.getType(RutaBasic.class.getName());
+
+    if (basicType == null) {
+      return false;
+    }
+
     Type type = annotation.getType();
 
     if (typeSystem.subsumes(basicType, type)) {