Hello Marc
Thanks for signalling that bug! I don't think that we need to create a
branch for such fixes. It would be nice if we could have a JUnit test
reproducing the bug, ideally without sis-shapefile dependency so we
could keep the test in the sis-feature module. The JUnit test and (if
you wish) the fix could be either attached in a JIRA task, or committed
directly if you wish (ideally on the JDK8 branch for making the merges
easier, but other branches or trunk are fine too).
Regards,
Martin
Le 28/09/14 20:07, Marc Le Bihan a écrit :
> Hello,
>
> I’ve just downloaded 0.5-SNAPSHOT version Friday, and I managed to make it
> works rather well by reading a shapefile from Openstreetmap.
>
> I encounter a trouble, however. The first value asked in a DenseFeature is
> always returning a null value.
>
>
> If I attempt to query the values of a Feature this way :
> "REF_INSEE", "COMMUNE", "CODE_POSTA",
> I will receive : null, “a city name”, “a zip code”.
>
> If I try to query this way :
> "CODE_POSTA", "REF_INSEE", "COMMUNE",
> I will receive : null, “an INSEE code”, “a city name”.
>
>
> after the init call of
> wrapValuesInProperties();
> the method assumes that it has done the same work it would have done with
> final Property property = ((Property[]) properties)[index];
> but it’s not the case.
>
>
> Involved method :
>
> @Override
> public Property getProperty(final String name) throws
> IllegalArgumentException {
> ArgumentChecks.ensureNonNull("name", name);
> final int index = getIndex(name);
> if (properties instanceof Property[]) {
> final Property property = ((Property[]) properties)[index];
> if (property != null) {
> return property;
> }
> } else {
> wrapValuesInProperties();
> }
> final Property property = createProperty(name);
> properties[index] = property;
> return property;
> }
>
> I may :
> - Attempt to correct the bug and send a branch somewhere with an unit test.
> - or Open a JIRA entry.
>
> what is the best ?
>
> Regards,
>
> M. Le Bihan