Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

身份证校验报错。。。 #2

Open
panlanghao opened this issue Apr 10, 2017 · 1 comment
Open

身份证校验报错。。。 #2

panlanghao opened this issue Apr 10, 2017 · 1 comment

Comments

@panlanghao
Copy link

Exception in thread "main" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

@shiylqq
Copy link

shiylqq commented Nov 23, 2017

jdk1.7会出现这个错误,在1.8下不会出现,原因是1.7的String.split方法会多出一个“”;
我使用另外的方法解决了:
替换54-57行
char[] bodyArr = code.getBody().toCharArray();
for (int j = 0; j < bodyArr.length; j++) {
bodySum += (Integer.valueOf(new Character(bodyArr[j]).toString(), 10) * posWeight[j]);
}
其他地方还有相似的问题,解决办法相同

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants