Later Edit: (why I don't think it's the same situation as here )
All the action is done in an instance method, in-and-out, one time for each file I process. The local field which I extract (instead of inlining) is not used anywhere else, so GC clears it anyway after an iteration...
--
In a standard J2SE app (main
method ran from Eclipse), while using apache pdfbox and pdf2dom for some pdf to html conversion, I wanted to clear some unneeded INFO log entries.
The unexpected situation:
This piece of code works fine every time:
Logger logger = Logger.getLogger("org.mabb.fontverter.opentype.TtfInstructions.TtfInstructionParser");
logger.setLevel(Level.WARNING);
But, if I inline the logger
variable, it starts to behave unexpectedly:
Logger.getLogger("org.mabb.fontverter.opentype.TtfInstructions.TtfInstructionParser").setLevel(Level.WARNING);
In the second case, the changes on the logger only take effect after a small time interval is allowed to pass:
- either if I debug and spend a few seconds inspecting the line
- or if I process more than one pdf file, meaning the entire execution take slightly longer...
What is the explanation for this ?
Thank you.