Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayOutOfBounds exception on deserialization #22

Closed
altavir opened this issue Dec 10, 2019 · 7 comments
Closed

ArrayOutOfBounds exception on deserialization #22

altavir opened this issue Dec 10, 2019 · 7 comments

Comments

@altavir
Copy link
Contributor

altavir commented Dec 10, 2019

Getting

java.lang.ArrayIndexOutOfBoundsException
	at nl.adaptivity.xmlutil.serialization.XmlDecoderBase$TagDecoder.decodeSerializableElement(XMLDecoder.kt:535)
	at nl.adaptivity.xmlutil.serialization.XmlDecoderBase$PolymorphicDecoder.decodeSerializableElement(XMLDecoder.kt:1054)
	at kotlinx.serialization.internal.AbstractPolymorphicSerializer.deserialize(AbstractPolymorphicSerializer.kt:59)
	at nl.adaptivity.xmlutil.serialization.XmlDecoderBase$TagDecoder.decodeNullableSerializableElement(XMLDecoder.kt:568)
	at scientifik.gdml.GDMLVolume$$serializer.deserialize(GDMLNode.kt)

on read from complicated input. Specifically this test.

@altavir
Copy link
Contributor Author

altavir commented Dec 10, 2019

Problem could be localized to this property. If I comment it, everything works.

@pdvrieze
Copy link
Owner

I'm having a look at it now. Btw. as it is a sealed class omitting the annotation should work correctly (I'm not sure about nested sealed classes - that may not work correctly yet).

@altavir
Copy link
Contributor Author

altavir commented Dec 17, 2019

I did not change the code yet, but got the error reported above and bizarre JS runtime error:

Cannot read property 'descriptor' of undefined
  ...
  at XmlDecoderBase$XmlDecoder.decodeSerializableValue_w63s0f$ (XMLDecoder.kt?5ffb:138)

I do not think they are related, but I need to figure it out, or I will have to roll back to the previous version.

@pdvrieze
Copy link
Owner

Javascript is nasty, but it looks like the javascript equivalent of an NPE. Btw. I've managed to create a simple test case for the original bug. It uses the "wrong" descriptor somehow. I should be able to fix it today.

@altavir
Copy link
Contributor Author

altavir commented Dec 18, 2019

Super. I am back to my 3d visualization and I want to release the next version with upgraded libraries.

pdvrieze added a commit that referenced this issue Dec 18, 2019
pdvrieze added a commit that referenced this issue Dec 18, 2019
@pdvrieze
Copy link
Owner

I've just pushed 0.14.0.1 that should fix it. I've tested it against your project and the current test works.

@altavir
Copy link
Contributor Author

altavir commented Dec 18, 2019

@pdvrieze I just checked and the second problem with JS I've mentioned above is resolved as well. They were related after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants