core: Fix ClassCastException when array values is set as List by takezoe · Pull Request #794 · msgpack/msgpack-java
Conversation
java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class [Lorg.msgpack.value.Value; ([Ljava.lang.Object; is in module java.base of loader 'bootstrap'; [Lorg.msgpack.value.Value; is in unnamed module of loader 'app')
at org.msgpack.value.Variable$ArrayValueAccessor.array(Variable.java:890)
at org.msgpack.value.Variable$ArrayValueAccessor.immutableValue(Variable.java:851)
at org.msgpack.value.Variable$ArrayValueAccessor.immutableValue(Variable.java:832)
at org.msgpack.value.Variable.immutableValue(Variable.java:1136)
at org.msgpack.value.Variable.toJson(Variable.java:1161)
| this.type = Type.LIST; | ||
| this.accessor = arrayAccessor; | ||
| this.objectValue = v.toArray(); | ||
| this.objectValue = v.toArray(new Value[v.size()]); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClassCastException occurs here:
| public Value[] array() | |
| { | |
| return (Value[]) objectValue; | |
| } |
xerial
changed the title
Fix ClassCastException when array values is set as List
core: Fix ClassCastException when array values is set as List
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters