xcx1r3 commented on issue #14719: URL: https://github.com/apache/lucene/issues/14719#issuecomment-2911474550
if an exception occur, the close() statement will not be executed, leading to a potential resource leak. ``` private int loadMainDataFromFile(String dctFilePath) throws IOException { int i, cnt, length, total = 0; // The file only counted 6763 Chinese characters plus 5 reserved slots 3756~3760. // The 3756th is used (as a header) to store information. int[] buffer = new int[3]; byte[] intBuffer = new byte[4]; String tmpword; DataInputStream dctFile = new DataInputStream(Files.newInputStream(Paths.get(dctFilePath))); .... dctFile.close(); -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org