Skip to content

TypeDescriptor hashCode could be improved #36746

@kilink

Description

@kilink

TypeDescriptor just returns the hashCode of the underlying raw type, but for parameterized types this can lead to different TypeDescriptors having the same hashes:

var listOfString = TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(String.class));
var listOfInteger = TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(Integer.class));
listOfString.hashCode() == listOfInteger.hashCode(); // true

This may impact conversion service caching / lookup due to increased hash collisions for instance.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: waiting-for-triageAn issue we've not yet triaged or decided on

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions