ICEpdf
  1. ICEpdf
  2. PDF-942

IndexOutOfBoundsException in PageViewComponentImpl - when painting the annotations

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.1, 6.0
    • Fix Version/s: 6.0.2
    • Component/s: Viewer RI
    • Labels:
      None
    • Environment:
      Windows, Eclipse RCP

      Description

      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}

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #46485 Mon Dec 07 13:07:29 MST 2015 patrick.corless PDF-942 removed cased annotation array length to try avoid an index out of bounds issue if an annotation is removed during a paint.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/viewer/src/org/icepdf/ri/common/views/PageViewComponentImpl.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #46484 Mon Dec 07 13:06:46 MST 2015 patrick.corless PDF-942 removed cased annotation array length to try avoid an index out of bounds issue if an annotation is removed during a paint.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-6.0.0_P01/icepdf/viewer/src/org/icepdf/ri/common/views/PageViewComponentImpl.java

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Pouya Yanki
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: