Skip to content

ReflectUtils.defineClass() ignores the ClassLoader argument in Java 11 #22416

Closed
@dvega

Description

@dvega

Affects: 5.1.5


In Java 11 ReflectUtils.defineClass() uses the new MethodHandles.Lookup.defineClass(), this method uses the contextClass's classloader, instead of the loader argument.

This difference in behaviour in Java 8 and Java 11 sometimes produces unexpected errors (eg. java.lang.LinkageError: attempted duplicate class definition)

Related issue #22310

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions