You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "picimako (via GitHub)" <gi...@apache.org> on 2023/11/15 08:25:29 UTC
[I] Simplifying TextAreaPrintStream in Luke [lucene]
picimako opened a new issue, #12809:
URL: https://github.com/apache/lucene/issues/12809
### Description
Hi,
I've been looking into how [`org.apache.lucene.luke.app.desktop.util.TextAreaPrintStream`](https://github.com/apache/lucene/blob/main/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/util/TextAreaPrintStream.java) is used in Luke, and I think its usage and its implementation may be simplified.
- It is used in `OptimizeIndexDialogFactory.ListenerFunctions` and `CheckIndexDialogFactory.ListenerFunctions`, both in a try-catch.
Since `TextAreaPrintStream` is closable, my first suggestion would be to use try-with-resources instead at those locations.
- Since there is always a new instance of `TextAreaPrintStream` instance created at the aforementioned locations, and they are flushed afterwards, it seems unnecessary to store the `ByteArrayOutputStream baos` field and call .reset() at all, when the `TextAreaPrintStream` instances are not reused.
Let me know what you think.
--
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-unsubscribe@lucene.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] Simplifying TextAreaPrintStream in Luke [lucene]
Posted by "pratikshelarkar (via GitHub)" <gi...@apache.org>.
pratikshelarkar commented on issue #12809:
URL: https://github.com/apache/lucene/issues/12809#issuecomment-1836594465
Hi, Can you please review my PR for this ticket?
--
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-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org