From: SourceForge.net <no...@so...> - 2007-07-22 11:29:56
|
Bugs item #1749949, was opened at 2007-07-08 18:40 Message generated for change (Comment added) made by kordzik You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=391879&aid=1749949&group_id=27895 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: In-Memory Impl Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Kordzik (kordzik) Assigned to: Nobody/Anonymous (nobody) Summary: Topic.createTopicName(...) throws NullPointerException Initial Comment: This refers to release 0.9.8, in-memory implementation (although I doubt it has influence on the bug). I use TMAPI interface. If it is attempted to create a TopicName with exactly the same value as previously removed TopicName (using Topic.createTopicName(String, Collection)), a RuntimeException is thrown, which is initiated by a NullPointerException. As far as I could infer, it has something to do with internal events that notify listeners (indexes probably?) that new name was created. The relevant part of the exception stack: Exception in thread "main" java.lang.RuntimeException: java.lang.NullPointerException at org.tm4j.tmapi.core.TMAPITopicImpl.createTopicName(TMAPITopicImpl.java:78) Example code to replicate the bug: //assumed TopicMap tm is instantianated beforehand //creating new user topic Topic type = tm.createTopic(); Topic t = tm.createTopic(); // creating scope collection Vector<Topic> scope = new Vector<Topic>(); scope.add(type); // creating name t.createTopicName("name", scope); //removing topic t.remove(); //creating new one t = tm.createTopic(); //RuntimeException occurs at the following line t.createTopicName("name", scope); ---------------------------------------------------------------------- >Comment By: Kordzik (kordzik) Date: 2007-07-22 13:26 Message: Logged In: YES user_id=1830063 Originator: YES Hello Mediumnet, Thank you for your response. I agree with the submitted code. Not sure about one thing only - if: "catch (TMAPIException ex) { fail("Unexpected exception: " + ex.toString()); }" will acutally catch the "bug" exception, since as far as I remember, a RuntimeException is thrown in this case. Or was it intented not to catch it? In the end, the test will fail anyway:) (as error, not failure) ---------------------------------------------------------------------- Comment By: Xuan Baldauf (mediumnet) Date: 2007-07-22 00:54 Message: Logged In: YES user_id=506885 Originator: NO Hello Kordzik, I can confirm you problem. I have added a test case accordingly to the sourcecode, as you can see here: https://sourceforge.net/mailarchive/message.php?msg_name=E1ICNgK-0003V3-7g%40mail.sourceforge.net . I assume that you agree with that. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=391879&aid=1749949&group_id=27895 |