Skip to content

Inconsistent default class loaders in hint classes #34470

Closed
@wilkinsona

Description

@wilkinsona

In the various hint related classes, there's a mixture of using ClassUtils.getDefaultClassLoader() and the hint class's own class loader:

ClassUtils.getDefaultClassLoader():

  • ReflectionHints
  • ObjectToObjectConverterRuntimeHints (delegates to ReflectionHints)

getClass().getClassLoader():

  • FilePatternResourceHintsRegistrar
  • ResourceHints
  • SpringFactoriesLoaderRuntimeHints

For consistency, I think the same default class loader should be used. My preference would be to use ClassUtils.getDefaultClassLoader().

In addition to the inconsistency across hints classes, it looks like SpringFactoriesLoaderRuntimeHints is inconsistent with SpringFactoriesLoader as the latter will use ClassUtils.getDefaultClassLoader().

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions