Skip to content

Release 4.11.0

Choose a tag to compare

@Builderb0y Builderb0y released this 09 Sep 23:01
· 5 commits to master since this release
  • Fixed self-referencing types stack overflowing when calling toString() on them.
    For example, public <C extends Comparable<C>> void foo(C c) {}.
    Attempting to resolve C as a declaration of foo's declaring class would create a self-referencing type,
    and attempting to call toString() on a ReifiedType would throw a StackOverflowError.
    This has now been fixed.
  • ReifiedType.unresolvableVariable() now takes the TypeVariable which failed to be resolved as a parameter, instead of the ReifiedType representing its upper bound.
    The reasons for this breaking change are as follows:
    1. The old method had no sanity checking that the provided bound extends the TypeVariable's declared bound.
    2. The old method left the unresolvable variable on the ReifiedType as null, which violates the
      spec which says the variable should be non-null when the classification is UNRESOLVABLE_VARIABLE.
    3. Without a TypeVariable to reference, the old method could not inherit annotations from that type variable.
  • Added Intern annotation for String decoding.
  • RecordCoder now sanity checks that fields with the same name as a parameter in the chosen constructor also have the same generic type as that parameter.
  • ReifiedType now has an uncheckedCast() method, so you don't need quite as many SuppressWarnings's anymore.
  • ReifiedType.from(Class<?>) is now cached.
  • EncodeInline/MultiLine/SingletonArray.INSTANCE now override equals(), hashCode(), and toString().