[ https://issues.apache.org/jira/browse/UIMA-2022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marshall Schor updated UIMA-2022: --------------------------------- Description: The method addFeature(...) on TypeSystemImpl, when the boolean multipleReferencesAllowed is not specified as an argument, default this to "true". The method addFeature(...) on an instance of TypeDescriptionImpl, when multipleReferencesAllowed is not specified as an argument, default this to "null". CasCreationUtils mergeFeatures(...) throws a ResourceInitializationException saying INCOMPATIBLE_MULTI_REFS if a feature is has multipleReferencesAllowed as true in one, and "null" in the other. The comment in the code says that "false" is the default. The use case driving this is reported in http://mail-archives.apache.org/mod_mbox/uima-user/201101.mbox/%3c267885741.1859849.1296090121503.javamail.r...@sz0143a.emeryville.ca.mail.comcast.net%3E. There are multiple ways to fix this. The actual type stores the value of multipleReferencesAllowed as a "boolean", so "null" is not an option. So, we can't change the value of the multipleReferencesAllowed default to match what happens in TypeDescriptionImpl, namely, to set the value to "null". Try changing the merge code to allow merging if the feature is not an array or a List (because multipleReferencesAllowed is only used for those cases). was: The method addFeature(...) on TypeSystemImpl, when the boolean multipleReferencesAllowed is not specified as an argument, default this to "true". The method addFeature(...) on an instance of TypeDescriptionImpl, when multipleReferencesAllowed is not specified as an argument, default this to "null". CasCreationUtils mergeFeatures(...) throws a ResourceInitializationException saying INCOMPATIBLE_MULTI_REFS if a feature is has multipleReferencesAllowed as true in one, and "null" in the other. The comment in the code says that "false" is the default. The use case driving this is reported in http://mail-archives.apache.org/mod_mbox/uima-user/201101.mbox/%3c267885741.1859849.1296090121503.javamail.r...@sz0143a.emeryville.ca.mail.comcast.net%3E. There are multiple ways to fix this. Change the value of the multipleReferencesAllowed default to match what happens in TypeDescriptionImpl, namely, to set the value to "null". > APIs for adding new feature to type are inconsistent in defaulting > multipleReferencesAllowed, leading to merge failures > ----------------------------------------------------------------------------------------------------------------------- > > Key: UIMA-2022 > URL: https://issues.apache.org/jira/browse/UIMA-2022 > Project: UIMA > Issue Type: Bug > Components: Core Java Framework > Affects Versions: 2.3.1SDK > Reporter: Marshall Schor > Assignee: Marshall Schor > > The method addFeature(...) on TypeSystemImpl, when the boolean > multipleReferencesAllowed is not specified as an argument, default this to > "true". > The method addFeature(...) on an instance of TypeDescriptionImpl, when > multipleReferencesAllowed is not specified as an argument, default this to > "null". > CasCreationUtils mergeFeatures(...) throws a ResourceInitializationException > saying INCOMPATIBLE_MULTI_REFS if a feature is has multipleReferencesAllowed > as true in one, and "null" in the other. The comment in the code says that > "false" is the default. > The use case driving this is reported in > http://mail-archives.apache.org/mod_mbox/uima-user/201101.mbox/%3c267885741.1859849.1296090121503.javamail.r...@sz0143a.emeryville.ca.mail.comcast.net%3E. > There are multiple ways to fix this. The actual type stores the value of > multipleReferencesAllowed as a "boolean", so "null" is not an option. So, we > can't change the value of the multipleReferencesAllowed default to match what > happens in TypeDescriptionImpl, namely, to set the value to "null". > Try changing the merge code to allow merging if the feature is not an array > or a List (because multipleReferencesAllowed is only used for those cases). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.