添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 "IllegalArgumentException: eq(null) is not allowed. Use isNull() instead" on collection with one element, which is null #2982 "IllegalArgumentException: eq(null) is not allowed. Use isNull() instead" on collection with one element, which is null #2982 Chriserus opened this issue Jul 29, 2021 · 1 comment

Observed vs. expected behavior

Actual: when passing collection with one parameter, which is null to the "in(T... right)" method, I get "IllegalArgumentException: eq(null) is not allowed. Use isNull() instead"

Expected: I don't get the above mentioned exception when passing collection with one element, which is null. I get results containing null in a field.

Steps to reproduce

In order to reproduce this bug, just use in(T... right) method located here at the moment of writing:
https://github.com/querydsl/querydsl/blob/master/querydsl-core/src/main/java/com/querydsl/core/types/dsl/SimpleExpression.java#L205
with a collection containing only one element, which is a null value.
Doing so you will get "java.lang.IllegalArgumentException: eq(null) is not allowed. Use isNull() instead" as we're using return eq(right[0]); and we should use isNull() instead.

Environment

Querydsl version: 4.4.0

Querydsl module: querydsl-core

Database: Oracle

JDK: 8

Additional details

In my opinion it's a simple fix and I can create a PR right after this Bug report.