You can check the source code of BigDecimal by unpacking the src.zip file in your JDK folder. Anyway, I checked for you, and line 647 is this: this(val.toCharArray(), 0, val.length());So that means that for the exception to come from this line you have somewhere a call to new BigDecimal with a null string. Since re isn't null and you say rev1 ...