We seem to be prone to a weird bug in our Java environment. We now had two cases of the same “cannot be” exception; in one case, the problem occurred 42,551 times during 48 minutes in the process, and then spontaneously cleared.
The failed code is triggered by this line:
return String.format("%1d%XY%d", source, System.currentTimeMillis(), quoteID);
where int source = 0and long quoteID = 44386874(for example).
The exception is:
java.util.UnknownFormatConversionException: Conversion = 'd'
at java.util.Formatter$FormatSpecifier.conversion(Formatter.java:2605)
at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2633)
at java.util.Formatter.parse(Formatter.java:2479)
at java.util.Formatter.format(Formatter.java:2413)
at java.util.Formatter.format(Formatter.java:2366)
at java.lang.String.format(String.java:2770)
Code validation 'd'should never raise this exception.
The best explanation we came up with is that the JIT compiler generates bad bytecode, but in the subsequent re-JIT it writes good code.
Does anyone have any experience on how to work around / diagnose such a problem?
Roger.