I\'m parsing a doc and I get the following error:
Exception in thread \"main\" java.lang.NumberFormatException: For input string: \"null\"
at sun.misc.Fl
The parseInt() and parseDouble() will error with NFE if passed with a null, space or blank string value. Once you have handled the null condition it will still fail with an empty string. Try adding a zero before the empty string like below. It maintains the integrity of calc as well:
Integer.parseInt(" ".trim())
to
Integer.parseInt( "0" + " ".trim())