Serializing TerrainBlock

In latest CVS there seems to be a problem with serializing. I get no exception in writeObject, but in readObject there is:


18.12.2005 02:20:25 de.worldofmystery.client.SlidingTerrainPage$IndexedTerrainBlock read
WARNUNG: read data/terrain.22.18.oos
java.lang.NullPointerException
        at com.jme.scene.Geometry.readObject(Geometry.java:798)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at de.worldofmystery.client.SlidingTerrainPage$IndexedTerrainBlock.read(SlidingTerrainPage.java:531)
        at de.worldofmystery.client.SlidingTerrainPage.load(SlidingTerrainPage.java:146)
        at de.worldofmystery.client.SlidingTerrainPage.checkTile(SlidingTerrainPage.java:341)
        at de.worldofmystery.client.SlidingTerrainPage.checkTiles(SlidingTerrainPage.java:408)
        at de.worldofmystery.client.SlidingTerrainPage.update(SlidingTerrainPage.java:297)
        at de.worldofmystery.client.Client.update(Client.java:626)
        at com.jme.app.BaseGame.start(BaseGame.java:74)
        at de.worldofmystery.client.Client.main(Client.java:134)


Testprogram to demonstrate the problem:



http://cvs.world-of-mystery.de/cgi-bin/cvsweb.cgi/wom/src/de/worldofmystery/client/TestSlidingTerrain.java

http://cvs.world-of-mystery.de/cgi-bin/cvsweb.cgi/wom/src/de/worldofmystery/client/SlidingTerrainPage.java



The NullPointerException occurs in com.jme.scene.Geometry.readObject() at texBuf.clear() in this context:


private void readObject(java.io.ObjectInputStream s) throws IOException,
 ............

Now I get a EOFException:

http://www.world-of-mystery.de/download/backtrace.txt

Ah, looks like that is due to an improper reuse of the len variable in that method.  please try once more.

It's fixed. I'm happy :wink:

Awesome, sorry for the trouble.