Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
0.8.2.1
-
None
-
None
-
Ubuntu 12.04, OSX 10.9, OpenJDK 7, Scala 2.10
Description
VarifiableProperties produces java.lang.NumberFormatException: null when a get method for a numeric type is called and VerifiableProperties was constructed with a Properties containing a numeric type.
private static void works()
{ Properties props = new Properties(); props.put("request.required.acks", "0"); new VerifiableProperties(props).getShort("request.required.acks", (short) 0); }private static void doesntWork()
{ Properties props = new Properties(); props.put("request.required.acks", (short) 0); new VerifiableProperties(props).getShort("request.required.acks", (short) 0); }Exception in thread "main" java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454)
at java.lang.Short.parseShort(Short.java:117)
at java.lang.Short.parseShort(Short.java:143)
at scala.collection.immutable.StringLike$class.toShort(StringLike.scala:228)
at scala.collection.immutable.StringOps.toShort(StringOps.scala:31)
at kafka.utils.VerifiableProperties.getShortInRange(VerifiableProperties.scala:85)
at kafka.utils.VerifiableProperties.getShort(VerifiableProperties.scala:61)
at Main.doesntWork(Main.java:22)