valerybokov commented on PR #443: URL: https://github.com/apache/pdfbox/pull/443#issuecomment-4391611392
> I'm not asking about the dispose, I'm asking about the line "if (printerGraphics != null && callerTransform != null)". printerGraphics is no longer null as soon as the assignment on line 221 is successful. So why check whether callerTransform isn't null? It will always be non null if the casted assignment was successful. Let's say this is a standard check, but it's really unlikely. Here are three cases. 1. If the graphics variable isn't a Graphics2D, a ClassCastException will occur. 2. There's an out-of-bounds error on line 223 (printerGraphics.getTransform). 3. The graphics parameter is null. Then there will be a null pointer exception. For all these cases, the result is the same: the finality block will be triggered, and the printerGraphics and callerTransform variables will be null. -- 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]
