ICEpdf
  1. ICEpdf
  2. PDF-1124

NullPointerException thrown when typing in a text annotation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.2, 6.2.1_P01, 6.2.2
    • Fix Version/s: 6.2.2
    • Component/s: API, Core/Rendering
    • Labels:
      None
    • Environment:
      All

      Description

      With a provided PDF file, adding a Text Annotation and then typing in the text field, causes an NPE to be thrown for every keystroke. It is also showing the text backwards, so 'test' is showing as 'tset'.

      Error stack trace:
      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
      at org.icepdf.ri.common.views.annotations.PopupAnnotationComponent.findAnnotationComponent(PopupAnnotationComponent.java:746)
      at org.icepdf.ri.common.views.annotations.PopupAnnotationComponent.updateContent(PopupAnnotationComponent.java:575)
      at org.icepdf.ri.common.views.annotations.PopupAnnotationComponent.insertUpdate(PopupAnnotationComponent.java:553)
      at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:202)
      at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:749)
      at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:708)
      at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130)
      at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:670)
      at javax.swing.text.JTextComponent.replaceSelection(JTextComponent.java:1379)
      at javax.swing.text.DefaultEditorKit$DefaultKeyTypedAction.actionPerformed(DefaultEditorKit.java:884)
      at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1662)
      at javax.swing.JComponent.processKeyBinding(JComponent.java:2878)
      at javax.swing.JComponent.processKeyBindings(JComponent.java:2925)
      at javax.swing.JComponent.processKeyEvent(JComponent.java:2841)
      at java.awt.Component.processEvent(Component.java:6293)
      at java.awt.Container.processEvent(Container.java:2229)
      at java.awt.Component.dispatchEventImpl(Component.java:4872)
      at java.awt.Container.dispatchEventImpl(Container.java:2287)
      at java.awt.Component.dispatchEvent(Component.java:4698)
      at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1887)
      at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:762)
      at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1027)
      at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:899)
      at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:727)
      at java.awt.Component.dispatchEventImpl(Component.java:4742)
      at java.awt.Container.dispatchEventImpl(Container.java:2287)
      at java.awt.Window.dispatchEventImpl(Window.java:2719)
      at java.awt.Component.dispatchEvent(Component.java:4698)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
      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.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
      at java.awt.EventQueue$4.run(EventQueue.java:708)
      at java.awt.EventQueue$4.run(EventQueue.java:706)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
      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)

        Activity

        Arran Mccullough created issue -
        Patrick Corless made changes -
        Field Original Value New Value
        Fix Version/s 6.2.2 [ 13097 ]
        Hide
        Patrick Corless added a comment -

        There is an annotation on the document that is inlined on the page and doesn't have an object reference. This doesn't happen very often as annotations are supposed to be referenced externally. Easy fix as the code in question is just trying to find the parent of the current popup annotation.

        Show
        Patrick Corless added a comment - There is an annotation on the document that is inlined on the page and doesn't have an object reference. This doesn't happen very often as annotations are supposed to be referenced externally. Easy fix as the code in question is just trying to find the parent of the current popup annotation.
        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #50540 Wed Feb 15 08:00:42 MST 2017 patrick.corless PDF-1124 added code protection for the off change an annotation doens't have a object reference number.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-6.2.0/icepdf/viewer/src/org/icepdf/ri/common/views/annotations/PopupAnnotationComponent.java
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: