From 1992db49f12641b8658a277137634f579041e5d8 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 13 Mar 2018 18:46:44 +0000 Subject: [PATCH] Suppress unchecked cast --- src/main/java/net/kemitix/conditional/FalseValueClause.java | 4 ++-- src/main/java/net/kemitix/conditional/TrueValueClause.java | 2 +- src/main/java/net/kemitix/conditional/Value.java | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/kemitix/conditional/FalseValueClause.java b/src/main/java/net/kemitix/conditional/FalseValueClause.java index b609428..f4283c3 100644 --- a/src/main/java/net/kemitix/conditional/FalseValueClause.java +++ b/src/main/java/net/kemitix/conditional/FalseValueClause.java @@ -33,11 +33,11 @@ import java.util.function.Supplier; */ class FalseValueClause implements Value.ValueClause { - protected static final Value.ValueClause FALSE = new FalseValueClause(); + protected static final Value.ValueClause FALSE = new FalseValueClause<>(); @Override public ValueSupplier then(final Supplier trueSupplier) { - return new FalseValueSupplier(); + return new FalseValueSupplier<>(); } @Override diff --git a/src/main/java/net/kemitix/conditional/TrueValueClause.java b/src/main/java/net/kemitix/conditional/TrueValueClause.java index 41707c3..46903c5 100644 --- a/src/main/java/net/kemitix/conditional/TrueValueClause.java +++ b/src/main/java/net/kemitix/conditional/TrueValueClause.java @@ -35,7 +35,7 @@ import java.util.function.Supplier; */ class TrueValueClause implements Value.ValueClause { - protected static final Value.ValueClause TRUE = new TrueValueClause<>(); + protected static final Value.ValueClause TRUE = new TrueValueClause<>(); @Override public ValueSupplier then(final Supplier trueSupplier) { diff --git a/src/main/java/net/kemitix/conditional/Value.java b/src/main/java/net/kemitix/conditional/Value.java index d41b481..c07737a 100644 --- a/src/main/java/net/kemitix/conditional/Value.java +++ b/src/main/java/net/kemitix/conditional/Value.java @@ -75,11 +75,12 @@ public interface Value { * * @return a true or false value clause */ + @SuppressWarnings("unchecked") static ValueClause where(final boolean clause) { if (clause) { - return TrueValueClause.TRUE; + return (ValueClause) TrueValueClause.TRUE; } - return FalseValueClause.FALSE; + return (ValueClause) FalseValueClause.FALSE; } /**