From 816a5b89c5ddb8e295b8e8e46075da3cb694b2a7 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 1 Jun 2015 13:10:49 +1000 Subject: Fix up static analysis issues (FindBugs and Intellij IDEA analysis) --- src/main/java/au/id/zancanaro/javacheck/Generators.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/au/id/zancanaro/javacheck/Generators.java') diff --git a/src/main/java/au/id/zancanaro/javacheck/Generators.java b/src/main/java/au/id/zancanaro/javacheck/Generators.java index 08b9989..bf1b1b3 100644 --- a/src/main/java/au/id/zancanaro/javacheck/Generators.java +++ b/src/main/java/au/id/zancanaro/javacheck/Generators.java @@ -15,13 +15,13 @@ public final class Generators { return (random, size) -> makeGenerator.apply(size).generate(random, size); } - public static Generator suchThat(Generator gen, Predicate pred) { + public static Generator suchThat(Generator gen, Predicate predicate) { return (random, size) -> { RoseTree result = gen.generate(random, size); - if (pred.test(result.getValue())) { - return result.filter(pred); + if (predicate.test(result.getValue())) { + return result.filter(predicate); } else { - return suchThat(gen, pred).generate(random, size); + return suchThat(gen, predicate).generate(random, size); } }; } -- cgit v1.2.3