From: Richard Heycock <rgh@ro...> - 2003-05-21 16:45:29
I have been trying to remove a resource from a collection using
Collection.removeResource() but it throws an exception:
Exception in thread "main" java.lang.NullPointerException
I added some debug into the CollectionImpl class and it turns out
that resources was null.
...(CollectionImpl.java:302) - resources: null
The first two lines show that the neither the collection or the
XMLresource is null.
I had a look at the storeResource() method and noticed that it's first
if(resources == null)
So I added this to the removeResource() method and it all works ok. Was
this the right thing to do?
"It is possible to make things of great complexity out of things
that are very simple. There is no conservation of simplicity"
-- Stephen Wolfram
Richard Heycock <rgh@...>
key fingerprint : 909D CBFA C669 AC2F A937 AFA4 661B 9D21 EAAB 4291
From: Wolfgang Meier <meier@if...> - 2003-05-22 15:36:06
> I had a look at the storeResource() method and noticed that it's first
> line is:
> =09if(resources =3D=3D null)
> So I added this to the removeResource() method and it all works ok. Was
> this the right thing to do?
Yes, the readCollection() call should be added there. Thanks for the fix.