我尝试通过使用IF条件比较两个数组值进行验证,如下所示:
if (!bomDataArray[1].trim().equals(agileDataArray[0].trim())) {
updateItemComments(bomDataArray[17], Constant.DESCRIPTOIN_MISMATCH);
}
我可以在服务器中使用sysout打印值。 代码:
System.out.println("bomDataArray[1].trim().equals(agileDataArray[0].trim() ---> "+bomDataArray[1].trim() + "---" +(agileDataArray[0].trim()));
服务器中的输出: [2018-02-26T17:22:51.158 + 0800] [Payara 4.1] [INFO] [] [] [tid:_ThreadID = 28 _ThreadName = http-thread-pool :: http-listener-1(5)] [timeMillis :1519636971158] [levelValue:800] [[ bomDataArray [1] .trim()。equals(agileDataArray [0] .trim()---&gt;电容器,陶瓷多层,表面安装(芯片)---电容器,陶瓷多层,表面安装(芯片)]] < / p>
运行此命令后,系统抛出ArrayIndexOutOfBoundsException。
堆栈追踪:
java.lang.ArrayIndexOutOfBoundsException: 1
at com.flextronics.pdp.parser.zhuhai.ZhuhaiBomComparisonParserPlugin.checkForAgileDiscrepancy(ZhuhaiBomComparisonParserPlugin.java:226)
at com.flextronics.pdp.parser.zhuhai.ZhuhaiBomComparisonParserPlugin.updateBomData(ZhuhaiBomComparisonParserPlugin.java:206)
at com.flextronics.pdp.parser.zhuhai.ZhuhaiBomComparisonParserPlugin.generatePdpItem(ZhuhaiBomComparisonParserPlugin.java:42)
at com.flextronics.pdp.parser.zhuhai.ZhuhaiBomComparisonParserPlugin.process(ZhuhaiBomComparisonParserPlugin.java:34)
at com.flextronics.pdp.core.engine.executor.java.JavaParserExecutor.transform(JavaParserExecutor.java:43)
at com.flextronics.pdp.core.engine.executor.PdpParserExecutor.execute(PdpParserExecutor.java:79)
at com.flextronics.pdp.core.engine.PdpEngine.parse(PdpEngine.java:60)
at com.flextronics.pdp.web.ux.viewmodels.documentcontrol.BomParsingViewModel.processBoms(BomParsingViewModel.java:717)
at sun.reflect.GeneratedMethodAccessor3720.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.zkoss.bind.impl.ParamCall.call(ParamCall.java:121)
at org.zkoss.bind.impl.BinderImpl.doGlobalCommandExecute(BinderImpl.java:1655)
at org.zkoss.bind.impl.BinderImpl.doGlobalCommand(BinderImpl.java:1625)
at org.zkoss.bind.impl.BinderImpl.access$300(BinderImpl.java:112)
at org.zkoss.bind.impl.BinderImpl$QueueListener.onEvent(BinderImpl.java:300)
at org.zkoss.zk.ui.event.impl.DesktopEventQueue$QueueListener.onEvent(DesktopEventQueue.java:162)
at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2752)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2723)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2664)
请帮助我了解哪个出了问题?