Skip to content

Optimize ClassUtils.forName() for more cases#1761

Closed
dreis2211 wants to merge 1 commit intospring-projects:masterfrom
dreis2211:SPR-16667
Closed

Optimize ClassUtils.forName() for more cases#1761
dreis2211 wants to merge 1 commit intospring-projects:masterfrom
dreis2211:SPR-16667

Conversation

@dreis2211
Copy link
Contributor

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