Overview

For a bit of background, we seem to have flipped back and forth between using Class.forName() and ClassLoader.loadClass() over the years, but in Spring Framework 5.1.1 we switched from ClassLoader.loadClass() to Class.forName() in ClassUtils.forName() (see #21867).

Thanks to a discovery made by @sormuras (see https://github.com/junit-team/junit5/pull/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:

https://github.com/spring-projects/spring-framework/blob/eda7af764bb9bd5be09fbd5d4625ecff0a052ee5/spring-core/src/main/java/org/springframework/util/ClassUtils.java#L300-L312

I removed that and tested locally in Eclipse and with a full Gradle build, and all tests pass.

Related Issues

  • https://github.com/junit-team/junit5/pull/4250
  • 21867