Skip to content

Inconsistent default class loaders in hint classes #34470

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().

Activity

  1. added
    in: coreIssues in core modules (aop, beans, core, context, expression)
    and removed on Feb 23, 2025
  2. added this to the 6.2.4 milestone on Feb 23, 2025
  3. self-assigned this
    on Feb 23, 2025
  4. added 2 commits that reference this issue on Feb 23, 2025
    634d1dd
    7460be6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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