Detail
Detail
Fehlerbehebung
DerivedTLTypePart.isDerived() wirft in manchen Fällen eine NullPointerException, zum Beispiel bei tl.legacy.tabletypes:hasRoleTable#source.
Stacktrace:
java.lang.NullPointerException at com.top_logic.element.meta.kbbased.ConfiguredAttributeImpl.createStorageImplementation(ConfiguredAttributeImpl.java:40) at com.top_logic.element.meta.kbbased.ConfiguredAttributeImpl.getStorageImplementation(ConfiguredAttributeImpl.java:33) at com.top_logic.element.meta.kbbased.ConfiguredAttributeImpl.getStorageImplementation(ConfiguredAttributeImpl.java:16) at com.top_logic.element.meta.AttributeOperations.isReadOnly(AttributeOperations.java:970) at com.top_logic.element.meta.kbbased.ConfiguredAttributeImpl.isDerived(ConfiguredAttributeImpl.java:46)
Analyse
Ursache ist, dass StorageImplementationFactory.createStorageImplementation(...) als Rückgabewert null liefert:
at com.top_logic.element.meta.kbbased.StorageImplementationFactory$1.visitAssociationEnd(StorageImplementationFactory.java:86) at com.top_logic.element.meta.kbbased.StorageImplementationFactory$1.visitAssociationEnd(StorageImplementationFactory.java:47) at com.top_logic.element.meta.kbbased.PersistentEnd.visitTypePart(PersistentEnd.java:163) at com.top_logic.element.meta.kbbased.StorageImplementationFactory.createDefaultStorageImplementation(StorageImplementationFactory.java:153) at com.top_logic.element.meta.kbbased.StorageImplementationFactory.createStorageImplementation(StorageImplementationFactory.java:127) at com.top_logic.element.meta.kbbased.ConfiguredAttributeImpl.createStorageImplementation(ConfiguredAttributeImpl.java:39)
Das wiederum liegt daran, dass StorageImplementationFactory.DEFAULT_STORAGE_IMPLEMENTATION.new TLTypePartVisitor() {...}.visitAssociationEnd(...) mit return null; implementiert ist, statt com.top_logic.element.meta.kbbased.NoStorage.INSTANCE zurückzuliefern.
Test
TestTLStructuredTypePart.testNoException()