You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Adam Lally (JIRA)" <ui...@incubator.apache.org> on 2008/02/01 18:05:08 UTC
[jira] Created: (UIMA-738) Calling jcas.getType for a type that is
not defined in the descriptor leaves the JCAS in an inconsitent state
Calling jcas.getType for a type that is not defined in the descriptor leaves the JCAS in an inconsitent state
-------------------------------------------------------------------------------------------------------------
Key: UIMA-738
URL: https://issues.apache.org/jira/browse/UIMA-738
Project: UIMA
Issue Type: Bug
Components: Core Java Framework
Affects Versions: 2.2.1
Reporter: Adam Lally
Assignee: Adam Lally
Fix For: 2.3
The following code illustrates the problem:
public void testUndefinedType() throws Exception {
//create jcas with no type system
JCas jcas = CasCreationUtils.createCas(new TypeSystemDescription_impl(), null, null).getJCas();
jcas.setDocumentText("This is a test.");
try {
//this should throw an exception
jcas.getType(Sentence.type);
fail();
} catch(CASRuntimeException e) {
}
//check that this does not leave JCAS in an inconsistent state
Iterator iter = jcas.getAnnotationIndex().iterator();
assertTrue(iter.hasNext());
Annotation annot = (Annotation)iter.next();
}
Running this gives a ClassCastException trying to cast the result of iter.next() to an Annotation
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (UIMA-738) Calling jcas.getType for a type that is
not defined in the descriptor leaves the JCAS in an inconsitent state
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Lally resolved UIMA-738.
-----------------------------
Resolution: Fixed
Assignee: Marshall Schor (was: Adam Lally)
Fixed. Marshall, please review.
> Calling jcas.getType for a type that is not defined in the descriptor leaves the JCAS in an inconsitent state
> -------------------------------------------------------------------------------------------------------------
>
> Key: UIMA-738
> URL: https://issues.apache.org/jira/browse/UIMA-738
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.2.1
> Reporter: Adam Lally
> Assignee: Marshall Schor
> Fix For: 2.3
>
>
> The following code illustrates the problem:
> public void testUndefinedType() throws Exception {
> //create jcas with no type system
> JCas jcas = CasCreationUtils.createCas(new TypeSystemDescription_impl(), null, null).getJCas();
> jcas.setDocumentText("This is a test.");
> try {
> //this should throw an exception
> jcas.getType(Sentence.type);
> fail();
> } catch(CASRuntimeException e) {
> }
> //check that this does not leave JCAS in an inconsistent state
> Iterator iter = jcas.getAnnotationIndex().iterator();
> assertTrue(iter.hasNext());
> Annotation annot = (Annotation)iter.next();
> }
> Running this gives a ClassCastException trying to cast the result of iter.next() to an Annotation
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (UIMA-738) Calling jcas.getType for a type that is
not defined in the descriptor leaves the JCAS in an inconsitent state
Posted by "Marshall Schor (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marshall Schor closed UIMA-738.
-------------------------------
> Calling jcas.getType for a type that is not defined in the descriptor leaves the JCAS in an inconsitent state
> -------------------------------------------------------------------------------------------------------------
>
> Key: UIMA-738
> URL: https://issues.apache.org/jira/browse/UIMA-738
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.2.1
> Reporter: Adam Lally
> Assignee: Marshall Schor
> Fix For: 2.2.2
>
>
> The following code illustrates the problem:
> public void testUndefinedType() throws Exception {
> //create jcas with no type system
> JCas jcas = CasCreationUtils.createCas(new TypeSystemDescription_impl(), null, null).getJCas();
> jcas.setDocumentText("This is a test.");
> try {
> //this should throw an exception
> jcas.getType(Sentence.type);
> fail();
> } catch(CASRuntimeException e) {
> }
> //check that this does not leave JCAS in an inconsistent state
> Iterator iter = jcas.getAnnotationIndex().iterator();
> assertTrue(iter.hasNext());
> Annotation annot = (Annotation)iter.next();
> }
> Running this gives a ClassCastException trying to cast the result of iter.next() to an Annotation
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.