Skip to content

feat(jdk-codemodel): promote EnumConstantDescriptor to Traitable and stamp its declaration-site source location#109

Merged
deer merged 2 commits into
mainfrom
enum_source
Jul 7, 2026
Merged

feat(jdk-codemodel): promote EnumConstantDescriptor to Traitable and stamp its declaration-site source location#109
deer merged 2 commits into
mainfrom
enum_source

Conversation

@deer

@deer deer commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

EnumConstantDescriptor used to only implement Trait, so unlike FieldDescriptor, FormalParameterDescriptor, and LambdaParameter, it had nowhere to attach a SourceLocation.FilePosition for the enum constant's declaration. This promotes it to also extend AbstractTraitable and implement Traitable, adding the @Marshal/@Unmarshal pair and Marshalling.register call needed for that, matching the structural shape of the earlier LambdaParameter promotion.

JdkInitializer.processMembers now calls addSourceLocation on each EnumConstantDescriptor it creates, the same way it already does for fields, methods, and parameters.

Also renamed LocationTraitTests to SourceLocationTests (and its test method names from ...ShouldCarryLocationTrait to ...ShouldCarrySourceLocation) since there is no LocationTrait type in the codebase -- the actual trait is SourceLocation, and the old name's javadoc reference to {@link LocationTrait} didn't resolve to anything.

@deer deer merged commit 7dd9f43 into main Jul 7, 2026
1 check passed
@deer deer deleted the enum_source branch July 7, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant