Skip to content

Commit e66b30b

Browse files
committed
PDFBOX-5660: replace runtime throw; remove unintended quotes
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1932636 13f79535-47bb-0310-9956-ffa450edef68
1 parent 13ecabb commit e66b30b

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public PDFDebugger(String initialViewMode)
248248
}
249249
else
250250
{
251-
new ErrorDialog(new IllegalArgumentException("Unknown view mode: " + "initialViewMode")).setVisible(true);
251+
new ErrorDialog(new IllegalArgumentException("Unknown view mode: " + initialViewMode)).setVisible(true);
252252
}
253253
}
254254

@@ -362,9 +362,9 @@ private void loadConfiguration()
362362
configuration.load(is);
363363
}
364364
}
365-
catch(IOException e)
365+
catch (IOException ex)
366366
{
367-
throw new RuntimeException(e);
367+
new ErrorDialog(ex).setVisible(true);
368368
}
369369
}
370370
}
@@ -516,9 +516,9 @@ protected void initGlobalEventHandlers()
516516
osxQuit.setAccessible(true);
517517
OSXAdapter.setQuitHandler(this, osxQuit);
518518
}
519-
catch (NoSuchMethodException e)
519+
catch (NoSuchMethodException ex)
520520
{
521-
throw new RuntimeException(e);
521+
new ErrorDialog(ex).setVisible(true);
522522
}
523523
}
524524
}
@@ -546,9 +546,9 @@ private JMenu createFileMenu()
546546
{
547547
readPDFurl(urlString, "");
548548
}
549-
catch (IOException | URISyntaxException e)
549+
catch (IOException | URISyntaxException ex)
550550
{
551-
throw new RuntimeException(e);
551+
new ErrorDialog(ex).setVisible(true);
552552
}
553553
});
554554
fileMenu.add(openUrlMenuItem);
@@ -1255,9 +1255,9 @@ private String convertToString( Object selectedNode )
12551255
return new String(in.readAllBytes());
12561256
}
12571257
}
1258-
catch( IOException e )
1258+
catch (IOException ex)
12591259
{
1260-
throw new RuntimeException(e);
1260+
new ErrorDialog(ex).setVisible(true);
12611261
}
12621262
}
12631263
if (selectedNode instanceof COSDictionary)
@@ -1586,9 +1586,9 @@ public void actionPerformed(ActionEvent actionEvent)
15861586
{
15871587
readPDFFile(filePath, "");
15881588
}
1589-
catch (Exception e)
1589+
catch (Exception ex)
15901590
{
1591-
throw new RuntimeException(e);
1591+
new ErrorDialog(ex).setVisible(true);
15921592
}
15931593
}
15941594
};

debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,10 @@ protected void done()
579579
label.setIcon(new HighResolutionImageIcon(image, label.getWidth(), label.getHeight()));
580580
label.setText(null);
581581
}
582-
catch (InterruptedException | ExecutionException e)
582+
catch (InterruptedException | ExecutionException ex)
583583
{
584-
label.setText(e.getMessage());
585-
throw new RuntimeException(e);
584+
label.setText(ex.getMessage());
585+
new ErrorDialog(ex).setVisible(true);
586586
}
587587
}
588588
}

0 commit comments

Comments
 (0)