Remove binary array name handling in ClassUtils.forName()
#34291
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Overview
For a bit of background, we seem to have flipped back and forth between using
Class.forName()
andClassLoader.loadClass()
over the years, but in Spring Framework 5.1.1 we switched fromClassLoader.loadClass()
toClass.forName()
inClassUtils.forName()
(see #21867).Thanks to a discovery made by @sormuras (see junit-team/junit5#4250), I have learned that
Class.forName()
has built-in support for binary array names; whereas,ClassLoader.loadClass()
does not.In light of that, we should be able to remove the following custom support for binary array names:
spring-framework/spring-core/src/main/java/org/springframework/util/ClassUtils.java
Lines 300 to 312 in eda7af7
I removed that and tested locally in Eclipse and with a full Gradle build, and all tests pass.
Related Issues
Class.forName()
junit-team/junit5#4250The text was updated successfully, but these errors were encountered: