Closed ptaillandier closed 7 years ago
Population generation is ok. But still have problem creating shape file in TestLocation.
Exception in thread "main" java.lang.NullPointerException at java.util.HashMap.merge(HashMap.java:1216) at java.util.stream.Collectors.lambda$toMap$173(Collectors.java:1320) at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) at java.util.Iterator.forEachRemaining(Iterator.java:116) at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at core.io.geo.GeofileFactory.createShapeFile(GeofileFactory.java:239) at core.io.GSExportFactory.createShapeFile(GSExportFactory.java:72) at spll.example.TestLocalisation.main(TestLocalisation.java:243)
In order to fix bug, you have to upload the new sample folder or generate a new configuration file, using the one in gospl
fixed (now, it is possible to save a population into a shapefile even if some entities do not have a location)
Had this bug as well. In last commit I added something on the constructor of the GoSplConfigurationFile to never have null. Was making my tests functional again, hope it makes sense ?
this.keyAttribute.putAll(keyAttribute == null ? Collections.emptyMap(): keyAttribute);
Hi,
The testLocation main (sell/example/TestLocation.java) does not work anymore. The problem comes from the population generation. The problem seems to come from the reading of the configuration file.
Log: Exception in thread "main" com.thoughtworks.xstream.converters.ConversionException: Failed calling method ---- Debugging information ---- message : Failed calling method cause-exception : java.lang.NullPointerException cause-message : null method : core.io.configuration.GosplConfigurationFile.readResolve() class : core.io.configuration.GosplConfigurationFile required-type : core.io.configuration.GosplConfigurationFile converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter path : /GosplConfiguration version : 1.4.9
Caused by: java.lang.NullPointerException at java.util.HashMap.putMapEntries(HashMap.java:500) at java.util.HashMap.putAll(HashMap.java:784) at core.io.configuration.GosplConfigurationFile.(GosplConfigurationFile.java:42)
at core.io.configuration.GosplConfigurationFile.readResolve(GosplConfigurationFile.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.thoughtworks.xstream.core.util.SerializationMembers.callReadResolve(SerializationMembers.java:78)
... 16 more