I’m getting some weird occasional nulls using Hand...
# http4k
d
I’m getting some weird occasional nulls using Handlebars. They show up with the approver as expected
<td style="text-align: right">£1.00</td>
actual
<td style="text-align: right">[NUL][NUL].[NUL][NUL]</td>
ie actual \0 in the output. Seems to be one in every few runs, randomly. Rerunning things are fine. Has anyone else seen anything similar?
Ah, is DecimalFormat not thread safe? Doh
Copy code
java.lang.NullPointerException: Cannot store to char array because "this.fastPathData.fastPathContainer" is null

	at java.base/java.text.DecimalFormat.resetFastPathData(DecimalFormat.java:1152)
	at java.base/java.text.DecimalFormat.checkAndSetFastPathStatus(DecimalFormat.java:1081)
	at java.base/java.text.DecimalFormat.fastFormat(DecimalFormat.java:1659)
	at java.base/java.text.NumberFormat.format(NumberFormat.java:327)
d
wat?! 🙄
d
It’s amazing isn’t it. I was using
NumberFormat.getCurrencyInstance(Locale._UK_)
, which returns
NumberFormat
, which says
Number formats are generally not synchronized.