mirror of https://github.com/apache/lucene.git
LUCENE-6949: fix (potential) resource leak in SynonymFilterFactory (https://scan.coverity.com/projects/5620 CID 120656)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1722856 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3a29f0ebe1
commit
7ba2b5d7d8
|
@ -214,6 +214,10 @@ Other
|
|||
* LUCENE-6945: factor out TestCorePlus(Queries|Extensions)Parser from
|
||||
TestParser, rename TestParser to TestCoreParser (Christine Poerschke)
|
||||
|
||||
* LUCENE-6949: fix (potential) resource leak in SynonymFilterFactory
|
||||
(https://scan.coverity.com/projects/5620 CID 120656)
|
||||
(Christine Poerschke, Coverity Scan (via Rishabh Patel))
|
||||
|
||||
======================= Lucene 5.4.0 =======================
|
||||
|
||||
New Features
|
||||
|
|
|
@ -171,7 +171,9 @@ public class SynonymFilterFactory extends TokenFilterFactory implements Resource
|
|||
List<String> files = splitFileNames(synonyms);
|
||||
for (String file : files) {
|
||||
decoder.reset();
|
||||
parser.parse(new InputStreamReader(loader.openResource(file), decoder));
|
||||
try (final Reader isr = new InputStreamReader(loader.openResource(file), decoder)) {
|
||||
parser.parse(isr);
|
||||
}
|
||||
}
|
||||
return parser.build();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue