Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add process WildcardElement and GenericPlaceholderElement (4.10) #1133

Merged
merged 1 commit into from Jul 16, 2023

Conversation

altro3
Copy link
Collaborator

@altro3 altro3 commented Jul 16, 2023

Fixed #1131

Boolean isArray = null;
Boolean isIterable = null;

ClassElement componentType = type != null ? type.getFirstTypeArgument().orElse(null) : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think you need to know if the element is generic or not, the actual type should represent the most upper one

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't agree. Without this changes this test will be failed:

    @Get("/get1")
    public <T extends Channel> String index1(@Nullable @QueryValue T[] channels) {
        return null;
    }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why exactly? It will not return that it’s an array?

Copy link
Collaborator Author

@altro3 altro3 Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I'm expecting to see an EnumElement, but I get GenericPlacehoderElement, so the processing goes the wrong way. If I comment this code, problem will be in red line:
изображение

I suspect that the problem arises only with enums

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have something like asEnum(), we have to complicated hierarchy

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, but I think at the moment this fix is quite correct and should be merged

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@altro3 altro3 changed the title Add process WildcardElement in generics Add process WildcardElement and GenericPlaceholderElement (4.10) Jul 16, 2023
@altro3 altro3 merged commit 583fabc into micronaut-projects:4.10.x Jul 16, 2023
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants