Skip to content

Commit

Permalink
use try with resource
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Nov 8, 2023
1 parent 7ac5357 commit 3f32c5d
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ static InputStream getInputStreamFromModelRepository(URI uri) throws IOException

static VocabularyParts loadVocabulary(URI uri) {
if (uri.getPath().endsWith(".json")) {
try {
InputStream vocabInputStream = getInputStreamFromModelRepository(uri);
try (InputStream vocabInputStream = getInputStreamFromModelRepository(uri)) {
return parseVocabParts(vocabInputStream);
} catch (Exception e) {
throw new ElasticsearchException("Failed to load vocabulary file", e);
Expand Down

0 comments on commit 3f32c5d

Please sign in to comment.