Hi Andrea, This is an issue yes, and I think i know why it is happening. But first off, yes a collection should never be returned as null. And if you look at the implementation of any InfoImpl you should see that collections are always initialized with a value. The problem comes up with xstream persistance, because xstream does not use the constructor mechanism for creating the objects when it depersists.
So why is this happening. My guess is because the way the xstream persistance is set up when it writes out an object (in this case a feature type) it omits elements for empty collections. To avoid elements of the nature: <metadata/> <metadataLinks/> etc... Now when the file is ready back in, the lack of these tags means that no value is initialized, and the collection is null. To get around this issues, if you look at the CatalogImpl whenever an object is added to the catalog, it is "resolved" and any uninitialized collections are initialized. And back to your initial problem, a check for metadataLinks is not being made. So it is an easy to fix. Will commit it shortly. -Justin Andrea Aime wrote: > Andrea Aime ha scritto: >> Andrea Aime ha scritto: >>> In fact looking in the javadocs of the xxxInfo objects I found >>> no assurances in that respect, but afaik that is considered >>> a good practice and apparently before the GSIP 34 hookup >>> it was true as well? >> Hum, considering the xxxInfo objects provide no setter for >> collections, this looks actually like a bug. No way >> to fill an empty collection ;-) > > Hmmm... I wiped out my data dir and started fresh, and I > cannot reproduce the issue anymore. > If I can reproduce and spot how it happens I'll let you > know. > > Cheers > Andrea > -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Geoserver-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-devel
