如图所示,只能添加注释
因为是日期格式有特殊字符"-",所以只能写成
if (0 != Integer.valueOf(in.replaceAll("-", ""))) { birthday = sf.parse(in); g.setBirthday(birthday); }
这样才不会报错