> On 09 Jul 2015, at 20:37, adelme...@apache.org wrote:
> 
> Author: adelmelle
> Date: Thu Jul  9 18:37:31 2015
> New Revision: 1690138
> 
> URL: http://svn.apache.org/r1690138
> Log:
> Minor tweak: avoid using standard toString() for detailed diagnostics purposes

Some background: 
The issues related to fonts that have been reported led me to try a debug 
session. 
Placing a breakpoint anywhere within FontInfo causes an issue in case font 
auto-detection is enabled, due to the fact that my IDE (IDEA) tries to call 
toString() to provide more info about the 'this' reference within that context. 
This triggers an iteration over ALL cached font triplets, which takes quite 
some time if you have a significant amount of fonts installed. 
Since the dumpAllTriplets...() method was the only one using 
FontInfo.toString() directly, it seemed like the appropriate solution was just 
to move that logic from the latter into the former method.

In general, I think toString() overrides should always be kept as concise and 
lightweight as possible. It is not the appropriate method to generate trace 
info, as it is so standard and publicly visible that it is difficult to predict 
how (often) external tools are going to be using and calling it.

 
KR

Andreas

Reply via email to