From: Kal A. <ka...@te...> - 2005-09-01 08:08:47
|
Hi Conal, I think that maybe the "right" thing to do here would be to change the definition of getBaseTopic() so that it must always return a Topic object and must return this when it has no base topic. Firstly that actually seems more natural and would let getBaseTopic() be used in a chain of method calls more safely; and secondly I think that there are other utilities (not just TopicMapWalker) that make this assumption. Cheers, Kal -----Original Message----- From: tm4...@li... [mailto:tm4...@li...] On Behalf Of Conal Tuohy Sent: 31 August 2005 23:26 To: tm4...@li... Subject: [Tm4j-developers] bug in TopicMapWalker We're writing a new back end which supports only "static merging" and this caused us to discover a bug in TM4J. On line 85 of org.tm4j.topicmap.util.TopicMapWalker it assumes that a Topic must have a non-null "base topic", though the javadoc for Topic.getBaseTopic() says that it may return null if a topic has no "base topic". Because our back end uses static (eager) merging, we don't have "base topics" at all, so we had an Topic implementation like this: public Topic getBaseTopic() { // doesn't support dynamic merging so this doesn't apply return null; } BTW to keep TopicMapWalker happy I've since changed it to: public Topic getBaseTopic() { // doesn't support dynamic merging so this doesn't apply return this; } Cheers Con ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Tm4j-developers mailing list Tm4...@li... https://lists.sourceforge.net/lists/listinfo/tm4j-developers |