Bug #3638
Frame.maintainTabOrder() is broken
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version:
History
#1 Updated by Ovidiu Maxiniuc almost 6 years ago
The logic in method maintainTabOrder()
from Frame
is not correct. There are cases when, in the first for
loop, to get an index overflow exception like this:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 5 at com.goldencode.p2j.ui.client.Frame.maintainTabOrder(Frame.java:8177) at com.goldencode.p2j.ui.client.Frame.enabledWidgetsByList(Frame.java:7566) at com.goldencode.p2j.ui.chui.ThinClient.processEnable(ThinClient.java:5146) at com.goldencode.p2j.ui.chui.ThinClient.enableWorker(ThinClient.java:5027) at com.goldencode.p2j.ui.chui.ThinClient.enable(ThinClient.java:4918) at com.goldencode.p2j.ui.chui.ThinClient.enable(ThinClient.java:4811) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:124) at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:757) at com.goldencode.p2j.net.Conversation.block(Conversation.java:412) at com.goldencode.p2j.net.Conversation.waitMessage(Conversation.java:348) at com.goldencode.p2j.net.Queue.transactImpl(Queue.java:1186) at com.goldencode.p2j.net.Queue.transact(Queue.java:657) at com.goldencode.p2j.net.BaseSession.transact(BaseSession.java:271) at com.goldencode.p2j.net.HighLevelObject.transact(HighLevelObject.java:211) at com.goldencode.p2j.net.RemoteObject$RemoteAccess.invokeCore(RemoteObject.java:1473) at com.goldencode.p2j.net.InvocationStub.invoke(InvocationStub.java:145) at com.sun.proxy.$Proxy4.standardEntry(Unknown Source) at com.goldencode.p2j.main.ClientCore.start(ClientCore.java:361) at com.goldencode.p2j.main.ClientCore.start(ClientCore.java:158) at com.goldencode.p2j.main.ClientDriver.start(ClientDriver.java:250) at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:444) at com.goldencode.p2j.main.ClientDriver.process(ClientDriver.java:144) at com.goldencode.p2j.main.ClientDriver.main(ClientDriver.java:313)
This happens because the focusSeq
array is created based on this.widgets
length but the for
loop iterates for widgetIds.length
times. Of course the error might come from enabledWidgetsByList
but there is no validation of the array dimension in maintainTabOrder
.