From: Kal A. <ka...@te...> - 2005-12-28 19:51:31
|
Thanks for the patch Lars. I've now applied a modified version to CVS. Handling 0 players is just a case of creating a wrapped AssociationRole object with a null player. However it is not really possible for the Wrapper to handle the case where a Member has >1 player, so the code now throws a TMAPIRuntimeException with a suitable message - not a perfect solution, but I think it's the best one given the constraints of TMAPI. Cheers, Kal > -----Original Message----- > From: tm4...@li... [mailto:tm4j-developers- > ad...@li...] On Behalf Of Lars Heuer > Sent: 21 December 2005 09:56 > To: George Tryfon > Cc: tm4...@li... > Subject: Re: [Tm4j-developers] TMAPI tm.getObjectById > (id_association_role) -> StackOverflowError > > Hi, > > [...] > >> org.tmapi.core.TopicMap tm; > >> AssociationRole ar = (AssociationRole)tm.getObjectById(idAssocRole); > > >> java.lang.StackOverflowError > > [...] > >> if the idAssocRole is not correct, the call gives null, > >> but if the idAssocRole is correct, StackOverflowError > > I think I've found the failure. > The method > Object wrap(Object obj, TMAPITopicMapImpl tm) > > forgets an argument (the player) if the "obj" is a Member instance and > calls itself again and again. It should call > AssociationRole wrap(org.tm4j.topicmap.Member obj, > org.tm4j.topicmap.Topic player, > TMAPITopicMapImpl tm) > > Maybe the attached patch helps. > Note, that the patch is only a hack (see the TODO annotation) and is > not tested. > > Best regards, > Lars > -- > http://semagia.com |