I was surprised that the following forward backward conversion from 32-bit ints to hex strings fails:
Integer.parseInt(-2028332484.toHexString, 16)
Gives:
java.lang.NumberFormatException: For input string: "871a1a3c"
Obviously a workaround is
java.lang.Long.parseLong(-2028332484.toHexString, 16).toInt
But I wonder if there is not a better (and possibly more Scala'ish) solution?