Long.getLong() failing, returning null to valid string
You can use Long.parseLong(String)
, instead of getLong(String)
: it will solve the problem.
You are missing the fact that Long.getLong(String str)
is not supposed to parse a String to a long, but rather to return a long value of a system property represented by that string. As others have suggested, what you actually need is Long.parseLong(String str)
.