使用帆软报表,导出 word
java.lang.Integer 对象 getChars 方法被执行时,抛出 ArrayIndexOutOfBoundsException,下标值 -81910
错误信息堆栈如下图
看了 JDK 中 java.lang.Integer getChars 方法的实现, j 的值应该不会出现负值。
Integer.getChars 作用及分析参见这篇 https://www.jianshu.com/p/c865983c41c1
简单说明一下就是,利用非取模方式,获取 Integer 对象的字符数组。
我猜测可能跟字符集有关系,让现场改了服务器字符集为中文 utf-8,重启了服务就好了。
但是从 Integer getChars 方法来看,跟字符集无关。
暂未想明白,记录一下!
【Java面试题与答案】整理推荐