You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Roaster backend drops or corrupts type-use annotations on field and return types #433
Found while tightening the conformance asserts in #430 (#420).
The Roaster backend loses type-use annotations in three positions:
Position
Input
Generated
Field type
@Nullable String
String (annotation dropped)
Method return type
@Nullable String
String (annotation dropped)
Return type with an annotated generic argument
List<@Nullable String>
void
Cause (Roaster 2.31.1.Final):
FieldImpl.setType → TypeImpl.fromString copies only FieldDeclaration.getType(). JDT parses the leading annotation into the declaration's modifiers, so it's lost.
MethodImpl.setReturnType → getReturnType2() has the same problem.
Types.splitGenerics strips all whitespace, so @Nullable String becomes @NullableString and the return type can't be parsed.
RoasterMapper itself renders the annotation correctly. Method/constructor parameters and generic arguments in fields/parameters are preserved.
Impact today: ordinary builder output isn't affected, because builder fields wrap the type in TrackedValue<…> and setter parameters keep the annotation (verified with jspecify @Nullable). Any generator emitting an annotated field type or return type directly is affected.
Related original implementations: type-use support in #111, Roaster migration in #139.
Activity
fix: preserve type-use annotations on Roaster field and return types (#…