Skip to content

Possible incorrect TypeVariable resolution in TypeParameterResolver #1794

Closed
@huan0huan

Description

@huan0huan

image

why not equals? This is bug ?

Activity

harawata

harawata commented on Dec 31, 2019

@harawata
Member

Please explain how to reproduce the problem.

huan0huan

huan0huan commented on Dec 31, 2019

@huan0huan
Author

I load mapper on my first visit after startup, which may occur when multithreaded access occurs

harawata

harawata commented on Dec 31, 2019

@harawata
Member

Please create a small demo project so that we can replicate the issue on our end.
Here are some project templates to start with. https://github.com/harawata/mybatis-issues

huan0huan

huan0huan commented on Dec 31, 2019

@huan0huan
Author
changed the title [-]Get return value question?[/-] [+]Possible incorrect TypeVariable resolution in TypeParameterResolver[/+] on Dec 31, 2019
self-assigned this
on Dec 31, 2019
added this to the 3.5.4 milestone on Dec 31, 2019
added a commit that references this issue on Dec 31, 2019

Fix for #1794 Comparing TypeVariable must be done by `equals()`

harawata

harawata commented on Dec 31, 2019

@harawata
Member

Thank you very much for the repro, @huan0huan !

You are right. The javadoc says:

Multiple objects may be instantiated at run-time to represent a given type variable. Even though a type variable is created only once, this does not imply any requirement to cache instances representing the type variable. However, all instances representing a type variable must be equal() to each other. As a consequence, users of type variables must not rely on the identity of instances of classes implementing this interface.

The fix is in the latest 3.5.4-SNAPSHOT.
Please let me know if you noticed anything!

added a commit that references this issue on Jan 4, 2020

Fix for mybatis#1794 Comparing TypeVariable must be done by `equals()`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @harawata@huan0huan

      Issue actions

        Possible incorrect TypeVariable resolution in TypeParameterResolver · Issue #1794 · mybatis/mybatis-3