Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rest: shorten the names of the generated classes #43786

Closed
mkouba opened this issue Oct 9, 2024 · 9 comments · Fixed by #44418
Closed

Rest: shorten the names of the generated classes #43786

mkouba opened this issue Oct 9, 2024 · 9 comments · Fixed by #44418
Labels
area/rest kind/enhancement New feature or request
Milestone

Comments

@mkouba
Copy link
Contributor

mkouba commented Oct 9, 2024

Description

There seems to be no reason for the names to be so looong.

For example io.quarkus.resteasy.reactive.server.runtime.exceptionmappers.AuthenticationFailedExceptionMapper$GeneratedExceptionHandlerFor$AuthenticationFailedException$OfMethod$handle. The simple name has 111 chars in this particular case.

The ArC > Beans view in the Dev UI does not look good. Also every call site of this class must store this name in the constant pool ;-).

Zulip discussion: https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Loooong.20names.20of.20generated.20classes.20in.20resteasy-reactive

Implementation ideas

No response

@mkouba mkouba added the kind/enhancement New feature or request label Oct 9, 2024
Copy link

quarkus-bot bot commented Oct 9, 2024

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip

This message is automatically generated by a bot.

@cescoffier
Copy link
Member

Any good solution outside computing a hash of the name?

@mkouba
Copy link
Contributor Author

mkouba commented Oct 14, 2024

Any good solution outside computing a hash of the name?

A computed hash is fine IMO.

@cescoffier
Copy link
Member

Hashes work but make debugging harder and logger names useless. But if that's the only solution, we must live with it.

@mkouba
Copy link
Contributor Author

mkouba commented Oct 14, 2024

Hashes work but make debugging harder and logger names useless. But if that's the only solution, we must live with it.

Well, I don't think we use loggers in these generated classes. As for the debugging - the base class is usually good enough to find out where to start. In case of the example above - io.quarkus.resteasy.reactive.server.runtime.exceptionmappers.AuthenticationFailedExceptionMapper is useful, but $GeneratedExceptionHandlerFor$AuthenticationFailedException$OfMethod$handle not that much.

Copy link

quarkus-bot bot commented Oct 14, 2024

/cc @FroMage (rest), @stuartwdouglas (rest)

@maxandersen
Copy link
Member

besides devui would these not show up in stacktraces too? all for not too long names but shouldn't also just be a hashid as name brings meaning :)

@cescoffier
Copy link
Member

If we can keep the meaningful part and append a hash, it would provide a good experience.

@geoand
Copy link
Contributor

geoand commented Nov 11, 2024

#44418 would make the name something like: io.quarkus.resteasy.reactive.server.runtime.exceptionmappers.AuthenticationFailedExceptionMapper$ExceptionMapper$123456

@geoand geoand closed this as completed in 5a71def Nov 12, 2024
geoand added a commit that referenced this issue Nov 12, 2024
Simplify name of generated exception mappers
@quarkus-bot quarkus-bot bot added this to the 3.17 - main milestone Nov 12, 2024
bschuhmann pushed a commit to bschuhmann/quarkus that referenced this issue Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants