java.lang.IndexOutOfBoundsException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector) is out of range. Applications can subclass this class to indicate similar exceptions.


rafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • In our application, we work a lot with annotations to highlight the most important parts of the PDF for our user. The IcePDF viewer tries to paint the annotations when the PDF page is first loaded in the {{PageViewComponentImpl.paintAnnotations()}}. There is a {{for}} loop in this method, which can not properly deal with concurrency and leads to the following exception. This exception sometimes leads to the freezing of the entire IcePdf component and our application. Note that our application performs all the GUI operations related to ICEPDF inside a {{SwingUtilities.invokeLater()}} to make sure it can only be performed withing the {{AWT}} thread. However, the it is still possible that an annotation is removed before the loop in the {{paintAnnotations()}} method is finished. {quote} Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 15, Size: 15 at java.util.ArrayList.rangeCheck(ArrayList.java:635) at java.util.ArrayList.get(ArrayList.java:411) at org.icepdf.ri.common.views.PageViewComponentImpl.paintAnnotations(PageViewComponentImpl.java:524) at org.icepdf.ri.common.views.PageViewComponentImpl.paintComponent(PageViewComponentImpl.java:463) at javax.swing.JComponent.paint(JComponent.java:1054) at javax.swing.JLayeredPane.paint(JLayeredPane.java:585) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JComponent.paint(JComponent.java:1063) at org.icepdf.ri.common.views.PageViewDecorator.paint(PageViewDecorator.java:141) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JComponent.paint(JComponent.java:1063) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5219) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1529) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1452) at javax.swing.RepaintManager.paint(RepaintManager.java:1249) at javax.swing.JComponent._paintImmediately(JComponent.java:5167) at javax.swing.JComponent.paintImmediately(JComponent.java:4978) at javax.swing.RepaintManager$3.run(RepaintManager.java:808) at javax.swing.RepaintManager$3.run(RepaintManager.java:796) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:769) at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:718) at javax.swing.RepaintManager.access$1100(RepaintManager.java:62) at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1677) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:703) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) {quote}
    via by Pouya Yanki,
  • In our application, we work a lot with annotations to highlight the most important parts of the PDF for our user. The IcePDF viewer tries to paint the annotations when the PDF page is first loaded in the {{PageViewComponentImpl.paintAnnotations()}}. There is a {{for}} loop in this method, which can not properly deal with concurrency and leads to the following exception. This exception sometimes leads to the freezing of the entire IcePdf component and our application. Note that our application performs all the GUI operations related to ICEPDF inside a {{SwingUtilities.invokeLater()}} to make sure it can only be performed withing the {{AWT}} thread. However, the it is still possible that an annotation is removed before the loop in the {{paintAnnotations()}} method is finished. {quote} Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 15, Size: 15 at java.util.ArrayList.rangeCheck(ArrayList.java:635) at java.util.ArrayList.get(ArrayList.java:411) at org.icepdf.ri.common.views.PageViewComponentImpl.paintAnnotations(PageViewComponentImpl.java:524) at org.icepdf.ri.common.views.PageViewComponentImpl.paintComponent(PageViewComponentImpl.java:463) at javax.swing.JComponent.paint(JComponent.java:1054) at javax.swing.JLayeredPane.paint(JLayeredPane.java:585) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JComponent.paint(JComponent.java:1063) at org.icepdf.ri.common.views.PageViewDecorator.paint(PageViewDecorator.java:141) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JComponent.paint(JComponent.java:1063) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5219) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1529) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1452) at javax.swing.RepaintManager.paint(RepaintManager.java:1249) at javax.swing.JComponent._paintImmediately(JComponent.java:5167) at javax.swing.JComponent.paintImmediately(JComponent.java:4978) at javax.swing.RepaintManager$3.run(RepaintManager.java:808) at javax.swing.RepaintManager$3.run(RepaintManager.java:796) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:769) at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:718) at javax.swing.RepaintManager.access$1100(RepaintManager.java:62) at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1677) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:703) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) {quote}
    via by Pouya Yanki,
  • Crash when acquiring GPS
    via GitHub by twyatt
    ,
  • POI regression testing report
    via by Unknown author,
    • java.lang.IndexOutOfBoundsException: Index: 15, Size: 15 at java.util.ArrayList.rangeCheck(ArrayList.java:635) at java.util.ArrayList.get(ArrayList.java:411) at org.adempiere.webui.panel.InfoPanel.getSaveKeys(InfoPanel.java:1207) at org.adempiere.webui.panel.InfoPanel$2.onEvent(InfoPanel.java:1923) at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2773) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2744) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2685) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136) at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:325) at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:348) at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:355) at org.adempiere.webui.apps.AbstractProcessDialog.runProcess(AbstractProcessDialog.java:794) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2755) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2685) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136) at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1765) at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1550) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1260) at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:611) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:485) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:494) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:499) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) at java.lang.Thread.run(Thread.java:745)

    Users with the same issue

    linxiaolong
    1 times, last one,
    harshg
    2 times, last one,
    asdasd
    6 times, last one,
    Unknown visitor1 times, last one,
    bpbhat77
    1 times, last one,
    235 more bugmates