Unidata / netcdf-java

The Unidata netcdf-java library
https://docs.unidata.ucar.edu/netcdf-java/current/userguide/index.html
BSD 3-Clause "New" or "Revised" License
146 stars 71 forks source link

Close/reacquire raf in gempak file reader #1136

Closed tdrwenski closed 1 year ago

tdrwenski commented 1 year ago

Description of Changes

This PR fixes the failing TDS test TestStationFcOpenFiles::checkFeatureTypePointWithMissing. This test fails when run after another test that uses the same file, since the GempakFileReader has its own copy of a RandomAccessFile which does not get properly closed and reacquired when the cache is cleared between the tests.

This PR closes/reaquires the GempakFileReader's RandomAccessFile. Another solution would be for it to not have its own RandomAccessFile member, but refer to that of the IOSP-- let me know if you prefer that one. It is probably not hard but I think there need to be new constructors for the GempakFileReader and so it seemed to require a few more changes in different places.

PR Checklist