2016-03-11 22:02 GMT+01:00 Ralph Goers <[email protected]>:
> I would trim it to a default max value - something like 10K. Even that seems
> like a lot. This should be configurable through our properties file.
>
> Ralph
>
Can we use something like:
protected static final int DEFAULT_STRING_BUILDER_RESIZE = 10 *
DEFAULT_STRING_BUILDER_SIZE;
protected static StringBuilder getStringBuilder() {
StringBuilder result = threadLocal.get();
if (result == null
|| result.length() > DEFAULT_STRING_BUILDER_RESIZE) {
result = new StringBuilder(DEFAULT_STRING_BUILDER_SIZE);
threadLocal.set(result);
}
result.setLength(0);
return result;
}
Luca
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]