@@ -166,8 +166,8 @@ table lists the optional conditions and shows how to use them:
166166| Null | where(id, isNull().filter(BooleanSupplier) | The condition will render if BooleanSupplier.getAsBoolean() returns true |
167167
168168### "When Present" Condition Builders
169- The library supplies several methods that supply conditions to be used in the common case of checking for null
170- values. The table below lists the rendering rules for each of these "when present" condition builder methods .
169+ The library supplies conditions for use in the common case of checking for null
170+ values. The table below lists the rendering rules for each of these "when present" conditions .
171171
172172| Condition | Example | Rendering Rules |
173173| ---------------------------| ---------------------------------------------------| ---------------------------------------------------------------|
@@ -184,14 +184,20 @@ values. The table below lists the rendering rules for each of these "when presen
184184| Not Like | where(id, isNotLikeWhenPresent(x)) | The condition will render if x is non-null |
185185| Not Like Case Insensitive | where(id, isNotLikeCaseInsensitiveWhenPresent(x)) | The condition will render if x is non-null |
186186
187- Note that these methods simply apply a "NotNull" filter to a condition. For example:
187+ With our adoption of JSpecify, it is now considered a misuse of the library to pass a null value into a condition
188+ unless the condition is one of the "when present" conditions. If you previously wrote code like this:
188189
189190``` java
190- // the following two lines are functionally equivalent
191- ... where (id, isEqualToWhenPresent(x)) ...
192191... where (id, isEqualTo(x). filter(Objects :: nonNull)) ...
193192```
194193
194+ Starting in version 2.0.0 of the library, you will now see IDE warnings related to nullability. You should change it
195+ to this:
196+
197+ ``` java
198+ ... where (id, isEqualToWhenPresent(x)) ...
199+ ```
200+
195201### Optionality with the "In" Conditions
196202Optionality with the "in" and "not in" conditions is a bit more complex than the other types of conditions. The rules
197203are different for the base conditions ("isIn", "isNotIn", etc.) and the "when present" conditions ("isInWhenPresent",
0 commit comments