Ticket #1062 (closed Defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Programmatically setting an assoc def's "Include in Label" flag throws exception

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.8.6
Component: DeepaMehta Standard Distribution Version: 4.8.5
Keywords: Cc: dgf, Malte, JuergeN, robert.schuster
Complexity: 3 Area:
Module: deepamehta-core

Description

When trying this:

dm4.getTopicType("...").getAssocDef("...").getChildTopics().set("dm4.core.include_in_label", false);

a ClassCastException is thrown:

Caused by: java.lang.ClassCastException: de.deepamehta.core.impl.AssociationModelImpl cannot be cast to de.deepamehta.core.model.AssociationDefinitionModel
   at de.deepamehta.core.impl.AssociationDefinitionModelImpl.postUpdate(AssociationDefinitionModelImpl.java:170)
   at de.deepamehta.core.impl.DeepaMehtaObjectModelImpl.update(DeepaMehtaObjectModelImpl.java:400)
   ... 31 more

Thanks to Robert for reporting!

Change History

comment:1 Changed 5 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 5 years ago by Jörg Richter <jri@…>

comment:3 Changed 5 years ago by Jörg Richter <jri@…>

comment:4 Changed 5 years ago by Jörg Richter <jri@…>

In 44f5da829813a4ad4d4c17f046661b81df348f32/deepamehta:

Core fix: assoc def child topics set (#1062).

ClassCastException? does not occur anymore.
Issues remain.

See #1062

comment:5 Changed 5 years ago by Jörg Richter <jri@…>

In 53cf93deadd6e110005f0b99650e043a205df676/deepamehta:

Core: internal refactoring (#1062).

See #1062

comment:6 Changed 5 years ago by Jörg Richter <jri@…>

In d04f370b5de1f0d6dec9c28bff281b5354c0effa/deepamehta:

Add test to illustrate another problem with #1062.

In conjunction with the progress in #1063 this works now:

assocDef.getChildTopics().set("dm4.core.include_in_label", true)

BUT only if no custom assoc type is set for the assoc def.
This is illustrated by the new test.

See #1062.

comment:7 Changed 5 years ago by Jörg Richter <jri@…>

In 6671c3e8a7b89d7e6398e8c658ecffea6f82944d/deepamehta:

Core: fix setting "Include in Label" (#1062).

Setting an assoc def's "Include in Label" flag works also if a custom assoc type is set for the assoc def:

assocDef.getChildTopics().set("dm4.core.include_in_label", true)

See #1062.

comment:8 Changed 5 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.