Skip to content

chore(codemodel-foundation): add getEmptyModuleTypeName convenience to NameProvider and CodeModel#117

Merged
deer merged 1 commit into
mainfrom
typename_cleanup
Jul 10, 2026
Merged

chore(codemodel-foundation): add getEmptyModuleTypeName convenience to NameProvider and CodeModel#117
deer merged 1 commit into
mainfrom
typename_cleanup

Conversation

@deer

@deer deer commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Callers that resolve a TypeName for the unnamed module were repeating the same two-step chain everywhere: nameProvider.getTypeName(Optional.empty(), fullyQualifiedName) or, further out, codeModel.getNameProvider().getTypeName(Optional.empty(), fullyQualifiedName). Both are now collapsed into a single getEmptyModuleTypeName(fullyQualifiedName) call.

NameProvider.getEmptyModuleTypeName is a default method that delegates to the existing getTypeName(Optional.empty(), fullyQualifiedName) overload. CodeModel.getEmptyModuleTypeName is a matching default method that delegates through getNameProvider(), mirroring the shape of the other convenience overloads already on CodeModel such as getTypeDescriptor and createTypeDescriptor.

All call sites across codemodel-foundation, jdk-codemodel, and jdk-annotation-processor were updated to use the new helper, including JDKModuleDescriptor and the bulk of the test suites that construct types by fully-qualified name.

@deer
deer merged commit 28f4b28 into main Jul 10, 2026
1 check passed
@deer
deer deleted the typename_cleanup branch July 10, 2026 07:03
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