Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TMAPI NameImpl produces NPEs #85

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 4 comments
Closed

TMAPI NameImpl produces NPEs #85

GoogleCodeExporter opened this issue Mar 16, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

     [java] 1) testName(org.tmapi.core.TestScoped)
java.lang.NullPointerException
     [java]     at net.ontopia.topicmaps.impl.tmapi2.NameImpl.removeTheme
(NameImpl.java:246)
     [java]     at org.tmapi.core.TestScoped._testScoped(TestScoped.java:
49)
     [java]     at org.tmapi.core.TestScoped.testName(TestScoped.java:84)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
     [java]     at net.ontopia.test.TestRunner.run(TestRunner.java:125)
     [java]     at net.ontopia.test.TestRunner.main(TestRunner.java:60)
     [java] 2) testUsedAsNameTheme
(org.tmapi.core.TestTopicRemovableConstraint)
java.lang.NullPointerException
     [java]     at net.ontopia.topicmaps.impl.tmapi2.NameImpl.removeTheme
(NameImpl.java:246)
     [java]     at org.tmapi.core.TestTopicRemovableConstraint._testScoped
(TestTopicRemovableConstraint.java:75)
     [java]     at
org.tmapi.core.TestTopicRemovableConstraint.testUsedAsNameTheme
(TestTopicRemovableConstraint.java:179)

Original issue reported on code.google.com by lars.he...@gmail.com on 20 Jul 2009 at 12:55

@GoogleCodeExporter
Copy link
Author

This is caused since the wrappedVariants is initialized with null. 

This should fix it:

  public void removeTheme(Topic theme) {
    super.removeTheme(theme);
    for (Variant v : getVariants()) {
      if (((VariantImpl) v).getExplicitScope().contains(theme))
        v.addTheme(theme);
    }
  }


I'd do it but I don't understand what the code does. If a theme is removed from 
a
name, that theme is added to the variant iff it is in getExplicitScope()?!?
Why doesn't the variant return the union of the explicit scope and the 'other' 
scope?!?
Commenting the code would help. :)

Original comment by lars.he...@gmail.com on 20 Jul 2009 at 1:04

@GoogleCodeExporter
Copy link
Author

I'm working on it. Including some comments ;)

Original comment by h.niederhausen@googlemail.com on 20 Jul 2009 at 1:06

@GoogleCodeExporter
Copy link
Author

This issue was closed by r345.

Original comment by h.niederhausen@googlemail.com on 20 Jul 2009 at 1:11

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Original comment by lar...@gmail.com on 1 Sep 2009 at 11:53

  • Added labels: Release5.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant