From 4c01b977b7e27f2c09165b20fcec60dd77072b1e Mon Sep 17 00:00:00 2001 From: Guille Date: Wed, 23 Oct 2019 11:51:01 +0200 Subject: [PATCH] Replace Java 11 API calls with Java 8 alternative calls --- src/org/opendatakit/briefcase/pull/aggregate/OpaqueCursor.java | 2 +- .../briefcase/model/form/FormMetadataCommandsTest.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/opendatakit/briefcase/pull/aggregate/OpaqueCursor.java b/src/org/opendatakit/briefcase/pull/aggregate/OpaqueCursor.java index 676dca9a8..d1b06ced4 100644 --- a/src/org/opendatakit/briefcase/pull/aggregate/OpaqueCursor.java +++ b/src/org/opendatakit/briefcase/pull/aggregate/OpaqueCursor.java @@ -23,7 +23,7 @@ public String getValue() { @Override public boolean isEmpty() { - return Optional.ofNullable(value).isEmpty(); + return !Optional.ofNullable(value).isPresent(); } @Override diff --git a/test/java/org/opendatakit/briefcase/model/form/FormMetadataCommandsTest.java b/test/java/org/opendatakit/briefcase/model/form/FormMetadataCommandsTest.java index 7892a5068..af51a00ae 100644 --- a/test/java/org/opendatakit/briefcase/model/form/FormMetadataCommandsTest.java +++ b/test/java/org/opendatakit/briefcase/model/form/FormMetadataCommandsTest.java @@ -21,6 +21,7 @@ import org.junit.Before; import org.junit.Test; import org.opendatakit.briefcase.pull.aggregate.Cursor; +import org.opendatakit.briefcase.reused.BriefcaseException; public class FormMetadataCommandsTest { @@ -79,7 +80,7 @@ public void updates_all_metadata_removing_cursors() { .stream() .map(FormMetadata::getKey) .forEach(key -> { - FormMetadata actualFormMetadata = formMetadataPort.fetch(key).orElseThrow(); + FormMetadata actualFormMetadata = formMetadataPort.fetch(key).orElseThrow(BriefcaseException::new); assertThat(actualFormMetadata.getCursor().isEmpty(), is(true)); }); }