Skip to content

Commit 7d6d4fe

Browse files
committed
remove redundant checks
1 parent 5505543 commit 7d6d4fe

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/main/java/org/folio/fqm/service/FqlToSqlConverterService.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -605,10 +605,7 @@ private static boolean shouldIncludeNull(FqlCondition<?> fqlCondition, Object de
605605
* Check if two values match, considering case-insensitivity for strings and type conversions
606606
*/
607607
private static boolean valuesMatch(Object queryValue, Object defaultValue, FieldCondition<?> fieldCondition, EntityType entityType) {
608-
if (queryValue == null && defaultValue == null) {
609-
return true;
610-
}
611-
if (queryValue == null || defaultValue == null) {
608+
if (queryValue == null) {
612609
return false;
613610
}
614611

@@ -627,7 +624,7 @@ private static boolean valuesMatch(Object queryValue, Object defaultValue, Field
627624
*/
628625
@SuppressWarnings("unchecked")
629626
private static boolean defaultValueSatisfiesGreaterThan(Object defaultValue, Object queryValue, boolean orEqualTo) {
630-
if (defaultValue == null || queryValue == null) {
627+
if (queryValue == null) {
631628
return false;
632629
}
633630

@@ -648,7 +645,7 @@ private static boolean defaultValueSatisfiesGreaterThan(Object defaultValue, Obj
648645
*/
649646
@SuppressWarnings("unchecked")
650647
private static boolean defaultValueSatisfiesLessThan(Object defaultValue, Object queryValue, boolean orEqualTo) {
651-
if (defaultValue == null || queryValue == null) {
648+
if (queryValue == null) {
652649
return false;
653650
}
654651

@@ -668,7 +665,7 @@ private static boolean defaultValueSatisfiesLessThan(Object defaultValue, Object
668665
* Check if the default value satisfies a startsWith condition
669666
*/
670667
private static boolean defaultValueSatisfiesStartsWith(Object defaultValue, String prefix) {
671-
if (defaultValue == null || prefix == null) {
668+
if (prefix == null) {
672669
return false;
673670
}
674671
// Case-insensitive comparison for strings
@@ -679,7 +676,7 @@ private static boolean defaultValueSatisfiesStartsWith(Object defaultValue, Stri
679676
* Check if the default value satisfies a contains condition
680677
*/
681678
private static boolean defaultValueSatisfiesContains(Object defaultValue, String substring) {
682-
if (defaultValue == null || substring == null) {
679+
if (substring == null) {
683680
return false;
684681
}
685682
// Case-insensitive comparison for strings

0 commit comments

Comments
 (0)