Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding features to superclass can trip up synchronization between JCas class and type system #389

Open
reckart opened this issue Sep 11, 2024 · 0 comments

Comments

@reckart
Copy link
Member

reckart commented Sep 11, 2024

Describe the bug
The JCas classes have an "offset" assigned to their features. When committing a type system, these offsets are set the first time a type system is committed and validated on subsequent type system commits. This can cause problems if the type systems contain different numbers of features for a given type.

To Reproduce
Steps to reproduce the behavior:

  1. Define a type MySuper with a feature x
  2. Define a type MySub with a feature z
  3. Generate JCas classes for both
  4. Load the type system description that defines the two types and add another feature y to MySuper
  5. Create a new JCas instance that uses the type system description from step 4
  6. Create a new JCas instance that uses the original type system description that does not contain y
  7. This should generate an error like
Caused by: org.apache.uima.UIMA_IllegalStateException: Loaded JCas Type MySub has feature z with two different type systems having different offsets; this is not supported.
     at org.apache.uima.cas.impl.FSClassRegistry.updateOrValidateAllCallSitesForJCasClass(FSClassRegistry.java:1662)
     ... 125 more

Expected behavior
When assigning feature offsets to be used in JCas classes, all features that are actually part of the JCas class should always be assigned first through the entire JCas class hierarchy. Offsets for features defined in the type system description but not in the JCas class should always be assigned afterwards. Features that are defined in the JCas class but not in the type system description should still get assigned an offset to ensure that their offset is not consumed by the time another type system is loaded that might include the feature.

Please complete the following information:

  • Version: 3.5.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant