pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1861702 - /pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Date Thu, 20 Jun 2019 16:32:12 GMT
Author: tilman
Date: Thu Jun 20 16:32:12 2019
New Revision: 1861702

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

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

Modified: pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java?rev=1861702&r1=1861701&r2=1861702&view=diff
==============================================================================
--- pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
(original)
+++ pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Thu Jun 20 16:32:12 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.debugger.ui.TextDialog;
 import org.apache.pdfbox.pdmodel.common.PDRectangle;
@@ -78,6 +80,7 @@ import org.apache.pdfbox.text.PDFTextStr
  */
 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;
@@ -107,11 +110,11 @@ public class PagePane implements ActionL
         try
         {
             collectFieldLocations();
-            collectLinkLocations();            
+            collectLinkLocations();
         }
         catch (IOException ex)
         {
-            // ignore
+            LOG.info(ex.getMessage(), ex);
         }
     }
 
@@ -157,7 +160,7 @@ public class PagePane implements ActionL
         }
     }
 
-    private void collectFieldLocations()
+    private void collectFieldLocations() throws IOException
     {
         PDAcroForm acroForm = document.getDocumentCatalog().getAcroForm();
         if (acroForm == null)
@@ -165,16 +168,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())
         {



Mime
View raw message