aboutsummaryrefslogtreecommitdiffstats
path: root/models-base/src
diff options
context:
space:
mode:
Diffstat (limited to 'models-base/src')
-rw-r--r--models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java4
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfObjectFilterTest.java8
2 files changed, 2 insertions, 10 deletions
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java b/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java
index 501d9c353..10ce4ea60 100644
--- a/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java
+++ b/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java
@@ -49,8 +49,8 @@ public interface PfObjectFilter<T extends Comparable<T>> {
* @param pattern the pattern to check against
* @return match or not
*/
- public default boolean filterString(@NonNull final String value, final String pattern) {
- return pattern == null || value.equals(pattern);
+ public default boolean filterString(final String value, final String pattern) {
+ return value == null || pattern == null || value.equals(pattern);
}
/**
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfObjectFilterTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfObjectFilterTest.java
index 3d16f8e3f..c13140726 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfObjectFilterTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfObjectFilterTest.java
@@ -84,14 +84,6 @@ public class PfObjectFilterTest {
assertFalse(dof.filterString("Hello", "Goodbye"));
assertTrue(dof.filterString("Hello", "Hello"));
- assertThatThrownBy(() -> {
- dof.filterString(null, null);
- }).hasMessage("value is marked @NonNull but is null");
-
- assertThatThrownBy(() -> {
- dof.filterString(null, "hello");
- }).hasMessage("value is marked @NonNull but is null");
-
assertEquals(false, dof.filterString("Hello", "Goodbye"));
assertEquals(true, dof.filterString("Hello", "Hello"));
assertEquals(true, dof.filterString("Hello", null));