diff --git a/javalib/src/main/scala/java/lang/IEEE754Helpers.scala b/javalib/src/main/scala/java/lang/IEEE754Helpers.scala index ed89c161cda..4f4ce6fcdf4 100644 --- a/javalib/src/main/scala/java/lang/IEEE754Helpers.scala +++ b/javalib/src/main/scala/java/lang/IEEE754Helpers.scala @@ -65,12 +65,12 @@ private[java] object IEEE754Helpers { val nChars = s.length if (nChars == 0) - throw new NumberFormatException(exceptionMsg(s)) + throw new NumberFormatException("nchars == 0 " + exceptionMsg(s)) val cStr: CString = stackalloc[scala.Byte](nChars + 1) if (_numericCharSeqToCString(s, nChars, cStr) == false) { - throw new NumberFormatException(exceptionMsg(s)) + throw new NumberFormatException("cannot convert to cstring " + exceptionMsg(s)) } val end = stackalloc[CString]() // Address one past last parsed cStr byte. @@ -86,10 +86,10 @@ private[java] object IEEE754Helpers { // or +/- infinity for values too +/- large for an IEEE754. // Slick C lib design! } else { - throw new NumberFormatException(exceptionMsg(s)) + throw new NumberFormatException(s"parse ($errno) " + exceptionMsg(s)) } } else if (!end == cStr) { // No leading digit found: only "D" not "0D" - throw new NumberFormatException(exceptionMsg(s)) + throw new NumberFormatException("end == cStr " + exceptionMsg(s)) } else { // Beware: cStr may have interior NUL/null bytes. Better to // consider it a counted byte array rather than a proper @@ -109,7 +109,7 @@ private[java] object IEEE754Helpers { while (idx < bytesLen) { // Check for garbage in the unparsed remnant. val b = cStr(idx.toUSize) if ((b < 0) || b > 0x20) { - throw new NumberFormatException(exceptionMsg(s)) + throw new NumberFormatException("garbage in unparsed remnant " + exceptionMsg(s)) } idx += 1 }