diff --git a/commons/src/main/java/com/navercorp/pinpoint/common/util/Predicates.java b/commons/src/main/java/com/navercorp/pinpoint/common/util/Predicates.java index 408952428fc5..6ed77e6dddab 100644 --- a/commons/src/main/java/com/navercorp/pinpoint/common/util/Predicates.java +++ b/commons/src/main/java/com/navercorp/pinpoint/common/util/Predicates.java @@ -8,7 +8,13 @@ private Predicates() { } @SuppressWarnings("rawtypes") - private static final Predicate IS_TRUE = new Predicate() { + private static final Predicate IS_TRUE = new TruePredicate(); + + @SuppressWarnings("rawtypes") + private static final Predicate IS_FALSE = new FalsePredicate(); + + @SuppressWarnings("rawtypes") + private static class TruePredicate implements Predicate { @Override public boolean test(Object o) { return true; @@ -16,12 +22,12 @@ public boolean test(Object o) { @Override public String toString() { - return "Predicates.isTrue()"; + return "TruePredicate"; } }; @SuppressWarnings("rawtypes") - private static final Predicate IS_FALSE = new Predicate() { + private static class FalsePredicate implements Predicate { @Override public boolean test(Object o) { return false; @@ -29,13 +35,13 @@ public boolean test(Object o) { @Override public String toString() { - return "Predicates.isFalse()"; + return "FalsePredicate"; } - }; + } @SuppressWarnings("unchecked") public static Predicate isTrue() { - return (Predicate) IS_TRUE; + return IS_TRUE; } @SuppressWarnings("unchecked")