8000 Use pretty aspect class names in errors by fmeum · Pull Request #28444 · bazelbuild/bazel · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@fmeum
Copy link
Collaborator
@fmeum fmeum commented Jan 26, 2026

Previously, the default toString() implementation was used, printing the full class name and hash code.

Previously, the default `toString()` implementation was used, printing the full class name and hash code.
@fmeum fmeum requested a review from tetromino January 26, 2026 21:35
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Jan 26, 2026
Copy link
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves error messages by using pretty aspect class names in TopLevelAspectsKey.getDescription(). The change is good, but I've suggested a small improvement to use Java 8 streams instead of Guava's Lists.transform for consistency with the existing codebase.

Comment on lines +379 to +381
Lists.transform(topLevelAspectsClasses, AspectClass::getName),
topLevelAspectsParameters,
targetLabel);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While Lists.transform works, using Java 8 streams would be more consistent with other parts of this file (e.g., lines 252 and 304 which use stream()...collect(toImmutableList())). This would also make the new import of com.google.common.collect.Lists unnecessary.

Suggested change
Lists.transform(topLevelAspectsClasses, AspectClass::getName),
topLevelAspectsParameters,
targetLabel);
topLevelAspectsClasses.stream().map(AspectClass::getName).collect(toImmutableList()),
topLevelAspectsParameters,
targetLabel);

@iancha1992 iancha1992 added the team-Starlark-Interpreter Issues involving the Starlark interpreter used by Bazel label Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Starlark-Interpreter Issues involving the Starlark interpreter used by Bazel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0