smallrye / jandex

Java Annotation Indexer
Apache License 2.0
398 stars 94 forks source link

restore serialization compatibility with Jandex 2 #324

Closed Ladicek closed 1 year ago

Ladicek commented 1 year ago

Jandex 3 added a new kind of types, type variable references. At that time, the index serialization code was not adjusted for serialization to an older version in case a type variable reference is present. Therefore, a Jandex 2 version of an index produced by Jandex 3 is not actually readable by Jandex 2.

Fortunately, there's a simple fix. What Jandex 3 represents as a type variable reference, Jandex 2 always represents as an unresolved type variable. Hence, with this commit, Jandex 3 simply serializes a type variable reference as an unresolved type variable when producing an index of an older versions.