From a188e41134a0a1555c985702cea3f51215d6f0d6 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Mon, 9 Aug 2021 15:38:14 +0200 Subject: [PATCH] Fix animal sniffer when run with Java 11 --- bramble-core/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bramble-core/build.gradle b/bramble-core/build.gradle index 1cd54717a..d6e813963 100644 --- a/bramble-core/build.gradle +++ b/bramble-core/build.gradle @@ -32,6 +32,14 @@ dependencies { signature 'org.codehaus.mojo.signature:java16:1.1@signature' } +animalsniffer { + // Allow requireNonNull: Android desugaring rewrites it (so it's safe for us to use), + // and it gets used when passing method references instead of lambdas with Java 11. + // Note that this line allows *all* methods from java.util.Objects. + // That's the best that we can do with the configuration options that Animal Sniffer offers. + ignore 'java.util.Objects' +} + // needed to make test output available to bramble-java configurations { testOutput.extendsFrom(testCompile)