Detail
#27204
PersistentEnumeration.tValue(...) leads to ClassCastException
The following call leads to an error in the demo: {{#!java TLModelUtil.resolveQualifiedName("tl5.enum:tl.beacon.three")
.tValueByName("annotations")
}}}
The cause is probably PersistentEnumeration.tValue(TLStructuredTypePart). There PersistentObjectImpl.getValue(this, part) is called. This ultimately leads to PrimitiveStorage.getAttributeValue(TLObject, TLStructuredTypePart). There, for the case attribute.isMultiple(), the storageValue is cast to String unchecked, but is a Config interface(PersistentModelPart$AnnotationConfigs).
Possibly the problem affects other classes and methods of the persistent model.
Noticed in the inspector: In the administration inspect the table of TLEnumerations. There tableData -> tableModel -> inner -> expand rows. Expanding rows fails and this error message appears in the log.
Stacktrace
java.lang.ClassCastException: class com.sun.proxy.$Proxy1285 cannot be cast to class java.lang.String (com.sun.proxy.$Proxy1285 is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @39c11e6c; java.lang.String is in module java.base of loader 'bootstrap') at com.top_logic.element.meta.kbbased.storage.PrimitiveStorage.getAttributeValue(PrimitiveStorage.java:132) at com.top_logic.element.meta.AttributeOperations.getAttributeValue(AttributeOperations.java:223) at com.top_logic.element.meta.kbbased.PersistentObjectImpl.getValue(PersistentObjectImpl.java:152) at com.top_logic.element.meta.kbbased.PersistentEnumeration.tValue(PersistentEnumeration.java:57) at com.top_logic.element.meta.kbbased.storage.PrimitiveStorage.getAttributeValue(PrimitiveStorage.java:132) at com.top_logic.element.meta.AttributeOperations.getAttributeValue(AttributeOperations.java:223) at com.top_logic.element.meta.kbbased.PersistentObjectImpl.getValue(PersistentObjectImpl.java:152) at com.top_logic.element.meta.kbbased.PersistentEnumeration.tValue(PersistentEnumeration.java:57) at com.top_logic.layout.inspector.model.nodes.InspectorTLObjectNode.makeChildren(InspectorTLObjectNode.java:57) at com.top_logic.layout.inspector.model.InspectorTreeBuilder.createChildList(InspectorTreeBuilder.java:46) [...]
Data Migration
Automatic data migration: Ticket_27204_Update_annotations_storage.migration.xml
Test
test.com.top_logic.element.meta.TestTLMetaModel