From 534073bd37c9124a1172ea6fb2dd509d6a376215 Mon Sep 17 00:00:00 2001 From: Tara Drwenski Date: Tue, 19 Dec 2023 09:54:22 -0700 Subject: [PATCH] Simplify code since DtCoverageAdapter.factory cannot return null --- tds/src/main/java/thredds/core/DatasetManager.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tds/src/main/java/thredds/core/DatasetManager.java b/tds/src/main/java/thredds/core/DatasetManager.java index 203d3f947d..71df3405b6 100644 --- a/tds/src/main/java/thredds/core/DatasetManager.java +++ b/tds/src/main/java/thredds/core/DatasetManager.java @@ -439,12 +439,8 @@ public CoverageCollection openCoverageDataset(HttpServletRequest req, HttpServle // and pass that to CoverageDataset DtCoverageDataset gds = new DtCoverageDataset(NetcdfDatasets.openDataset(location)); if (!gds.getGrids().isEmpty()) { - Formatter errlog = new Formatter(); - FeatureDatasetCoverage result = DtCoverageAdapter.factory(gds, errlog); - if (result != null) - opt = Optional.of(result); - else - opt = Optional.empty(errlog.toString()); + FeatureDatasetCoverage result = DtCoverageAdapter.factory(gds, new Formatter()); + opt = Optional.of(result); } }