Modify NitfReading classes to support closing / try with resources#191
Modify NitfReading classes to support closing / try with resources#191svargasConnexta wants to merge 1 commit intocodice:masterfrom
Conversation
|
|
| } | ||
| } | ||
|
|
||
| @Override public void close() throws Exception { |
There was a problem hiding this comment.
@Override would be better on a separate line.
There was a problem hiding this comment.
I vaguely remember us running into a problem with closing this stream because it was being passed around within Alliance. I think that since we've added .end() to the fluent classes, we might be ok to use this, now. We should verify that it doesn't cause a problem outside of imaging-nitf, however.
b77a871 to
811f204
Compare
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
============================================
+ Coverage 88.14% 88.15% +<.01%
- Complexity 2068 2069 +1
============================================
Files 199 199
Lines 6309 6314 +5
Branches 494 494
============================================
+ Hits 5561 5566 +5
+ Misses 567 566 -1
- Partials 181 182 +1 |
I ran into a locked file bug that stemmed from this module while working on integration tests for another project. The problem starts here, a
NitfInputStreamReaderis created with a newFileInputStreamobject inside of it. There is no way to close thatFileInputStreamobject other than relying on garbage collection which leads to bugs. This PR is to make the miscellaneous nitf parsing objects closeable to prevent these bugs.