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
AnnotationDto.setAnnotationType accepts invalid type kinds (generic/array/map/set/wildcard) #445
AnnotationDto#setAnnotationType(TypeName) accepts any TypeName subclass — including TypeNameGeneric, TypeNameArray, TypeNameMap, TypeNameSet and TypeNameWildcard. None of those can ever be valid annotation types: Java annotations cannot declare type parameters, be arrays, or be wildcards, so an AnnotationDto built with one is unrepresentable and produces broken generated source late in the pipeline instead of failing fast.
Surfaced in #429 review: the annotationType builder shortcuts made it easy to construct such invalid models.
Expected behavior
setAnnotationType (and the builder path) should reject non-plain type kinds with an IllegalArgumentException (or similar), so invalid models fail at construction time. Valid inputs: plain TypeName (incl. nested/plain class types) — the only shapes a real annotation type can have.
Scope
validation in AnnotationDto.setAnnotationType
tests for rejected kinds and accepted plain types
behavior change: strictly it can break callers who (accidentally) relied on the lenient behavior — call out in release notes
Activity
fix(codegen-core): reject non-plain type kinds in AnnotationDto.setAn…
feat(codegen-core): Class-based import constructors + AnnotationDto t…