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

.dispose throws NPE #11

Open
phillord opened this issue Feb 6, 2016 · 3 comments
Open

.dispose throws NPE #11

phillord opened this issue Feb 6, 2016 · 3 comments
Labels

Comments

@phillord
Copy link

phillord commented Feb 6, 2016

I'm getting a NPE from dispose().

Root cause of the problem appears to be that the ConcurrentOWLOntologyImpl can return null with
getOWLOntologyManager -- in this case, because I have already removed the OWLOntology from the OWLOntologyManager myself.

Not sure whose fault this is really. I can dispose the reasoner before I detact the ontology from the manager. But if this is required, I guess, the OWL API doc needs updating to state that this is necessary.

@ignazio1977
Copy link
Contributor

It's a bug introduced by a feature I added :-) even after removing an ontology from a manager, it was not possible to remove the manager from the ontology, so getOWLOntologyManager() never returned null.
However, when I added the ability to move an ontology from one manager to another, this required making the manager settable - introducing the ability to remove it from the ontology.

dispose() needs to be updated to do a null check. In the meantime, the workaround is to call dispose() before removing the ontology from the manager.

@ignazio1977 ignazio1977 added the bug label Feb 6, 2016
@phillord
Copy link
Author

phillord commented Feb 6, 2016

Yeah, I guessed it was your fault:-)

If you fix it, though, is the reasoner going to stop listening to the ontology (although the error occurs when I am trying to ditch the ontology, so it's probably not that important).

@ignazio1977
Copy link
Contributor

Yes it's intended to stop listening to updates.

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

No branches or pull requests

2 participants