You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2019/06/20 16:32:07 UTC

svn commit: r1861701 - /pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java

Author: tilman
Date: Thu Jun 20 16:32:07 2019
New Revision: 1861701

URL: http://svn.apache.org/viewvc?rev=1861701&view=rev
Log:
PDFBOX-2941: SonarQube fix

Modified:
    pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java

Modified: pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java?rev=1861701&r1=1861700&r2=1861701&view=diff
==============================================================================
--- pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java (original)
+++ pdfbox/branches/issue4569/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java Thu Jun 20 16:32:07 2019
@@ -54,6 +54,8 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.debugger.ui.HighResolutionImageIcon;
 import org.apache.pdfbox.pdmodel.common.PDRectangle;
 import org.apache.pdfbox.pdmodel.interactive.action.PDAction;
@@ -76,6 +78,7 @@ import org.apache.pdfbox.pdmodel.interac
  */
 public class PagePane implements ActionListener, AncestorListener, MouseMotionListener, MouseListener
 {
+    private static final Log LOG = LogFactory.getLog(PagePane.class);
     private final PDDocument document;
     private final JLabel statuslabel;
     private final PDPage page;
@@ -105,11 +108,11 @@ public class PagePane implements ActionL
         try
         {
             collectFieldLocations();
-            collectLinkLocations();            
+            collectLinkLocations();
         }
         catch (IOException ex)
         {
-            // ignore
+            LOG.info(ex.getMessage(), ex);
         }
     }
 
@@ -155,7 +158,7 @@ public class PagePane implements ActionL
         }
     }
 
-    private void collectFieldLocations()
+    private void collectFieldLocations() throws IOException
     {
         PDAcroForm acroForm = document.getDocumentCatalog().getAcroForm();
         if (acroForm == null)
@@ -163,16 +166,9 @@ public class PagePane implements ActionL
             return;
         }
         Set<COSDictionary> dictionarySet = new HashSet<>();
-        try
-        {
-            for (PDAnnotation annotation : page.getAnnotations())
-            {
-                dictionarySet.add(annotation.getCOSObject());
-            }
-        }
-        catch (IOException ex)
+        for (PDAnnotation annotation : page.getAnnotations())
         {
-            return;
+            dictionarySet.add(annotation.getCOSObject());
         }
         for (PDField field : acroForm.getFieldTree())
         {