Closed Gohla closed 3 years ago
That's definitely an obscure bug. Also, isn't Java great? A transient
field with a default value doesn't get its default value when deserializing, makes total sense...
Well, defaults values are not part of the JVM bytecode, they get translated to code in a constructor, which doesn't get called when deserialized 😁
protected <init>(Lorg/spoofax/interpreter/terms/IStrategoList;)V
L0
LINENUMBER 31 L0
ALOAD 0
INVOKESPECIAL org/spoofax/terms/AbstractSimpleTerm.<init> ()V
L1
LINENUMBER 27 L1
ALOAD 0
ICONST_M1
PUTFIELD org/spoofax/terms/StrategoTerm.hashCode : I
Well, defaults values are not part of the JVM bytecode, they get translated to code in a constructor, which doesn't get called when deserialized 😁
Sounds like a leaky abstraction to me then 😉
See comment in the method. I tested this locally and the build succeeds (and it fixes the term equality bug that I encountered)