Detail
#27204
PersistentEnumeration.tValue(...) führt zu ClassCastException
Folgender Aufruf führt im Demo zu einem Fehler: {{{#!java TLModelUtil.resolveQualifiedName("tl5.enum:tl.beacon.three")
.tValueByName("annotations")
}}}
Ursache ist vermutlich PersistentEnumeration.tValue(TLStructuredTypePart). Dort wird PersistentObjectImpl.getValue(this, part) aufgerufen. Das führt letztlich zu PrimitiveStorage.getAttributeValue(TLObject, TLStructuredTypePart). Dort wird für den Fall attribute.isMultiple() der storageValue ungeprüft auf String gecastet, ist aber ein Config-Interface (PersistentModelPart$AnnotationConfigs).
Eventuell betrifft das Problem weitere Klassen und Methoden des persistenten Modells.
Aufgefallen im Inspektor: In der Administration die Tabelle der TLEnumerations inspizieren. Dort tableData -> tableModel -> inner -> rows aufklappen. Das Aufklappen von rows schlägt fehl und es kommt diese Fehlermeldung im 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
Automatische Datenmigration: Ticket_27204_Update_annotations_storage.migration.xml
Test
test.com.top_logic.element.meta.TestTLMetaModel