Skip to content

Commit

Permalink
Simplify code since DtCoverageAdapter.factory cannot return null
Browse files Browse the repository at this point in the history
  • Loading branch information
tdrwenski committed Dec 19, 2023
1 parent 43a2bb4 commit fcb3152
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tds/src/main/java/thredds/core/DatasetManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit fcb3152

Please sign in to comment.