apache / apache/grails-intellij-plugin

Grails dynamic finder InList has incorrect incompatible types inspection when passing a non-List collection

Open
#316 0 comments 0 reactions 0 assignees View on GitHub
bug imported-from-youtrack
Dominant language
Java
Stars
17
Forks
4
Avg merge
5d 15h
Merged PRs (30d)
4

Description

The Grails "findAllBy…InList" supports any Collection as can be seen here: [https://github.com/grails/grails-data-mapping/blob/c4ef4d0348848cbf4b54783b79b6c694b7b3aae1/grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/finders/MethodExpression.java#L270](https://github.com/grails/grails-data-mapping/blob/c4ef4d0348848cbf4b54783b79b6c694b7b3aae1/grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/finders/MethodExpression.java#L270)

When attempting to pass a Set (or any other collection), IDEA shows an inspection error saying 'findAllBy…InList' in '…' cannot be applied to '(…)'

---

*Imported from [IDEA-177686](https://youtrack.jetbrains.com/issue/IDEA-177686) · Type: Bug · Votes: 0*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading MethodExpression.java around line 270, where the InList collection behavior is shown, then trace the IntelliJ inspection that reports incompatible argument types for findAllBy…InList. Done means passing a Set or another non-List Collection no longer produces the incorrect inspection error.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.