Skip to content

Optimize ClassUtils.forName() for more cases #1761

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

Closed
wants to merge 1 commit into from

Conversation

dreis2211
Copy link
Contributor

@@ -138,6 +140,9 @@
Object.class, Object[].class, Class.class, Class[].class);
registerCommonClasses(Throwable.class, Exception.class, RuntimeException.class,
Error.class, StackTraceElement.class, StackTraceElement[].class);
registerCommonClasses(Enum.class, Optional.class);
registerCommonClasses(Collection.class, List.class, Map.class, Set.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would go even further here and register Iterable and Iterator as well (collapsed and reordered):

registerCommonClasses(Collection.class, List.class, Set.class, Map.class,
        Iterable.class, Iterator.class, Enum.class, Optional.class);

@jhoeller
Copy link
Contributor

I've rolled in a slightly revised variant, co-initializing the javaLanguageInterfaces set. Thanks for the PR!

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.

2 participants