valerybokov commented on PR #383:
URL: https://github.com/apache/pdfbox/pull/383#issuecomment-3691338433
> ChatGPT disagrees, and I usually treat it as a mainstream opinion on a
topic (and I'm aware that it is hallucinating sometimes)
I don't care what the ДhatGPT responds to. As I stated earlier, I checked
all cases, and this method always returned a BufferedInputStream. This method
returns an InputStream, which is the parent class of BufferedInputStream. Java
doesn't really guarantee that it will always return a BufferedInputStream.
Therefore, I suggested adding a check there. In my opinion, this is better than
double synchronization.
InputStream is = SomePdfBoxClass.class.getResourceAsStream(somePath);
if (!(is instanceof BufferedInputStream))
is = new BufferedInputStream(is);
//another part of the code
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]