File tree Expand file tree Collapse file tree
debugger/src/main/java/org/apache/pdfbox/debugger Expand file tree Collapse file tree Original file line number Diff line number Diff line change 137137import org .apache .pdfbox .debugger .ui .XrefEntry ;
138138import org .apache .pdfbox .debugger .ui .ZoomMenu ;
139139import org .apache .pdfbox .filter .FilterFactory ;
140+ import org .apache .pdfbox .io .IOUtils ;
140141import org .apache .pdfbox .io .RandomAccessReadBuffer ;
141142import org .apache .pdfbox .pdmodel .PDDocument ;
142143import org .apache .pdfbox .pdmodel .common .PDPageLabels ;
@@ -1290,23 +1291,12 @@ private String convertToString( Object selectedNode )
12901291
12911292 private void exitMenuItemActionPerformed (ActionEvent ignored )
12921293 {
1293- if ( document != null )
1294+ IOUtils .closeQuietly (document );
1295+ if (!currentFilePath .startsWith ("http" ))
12941296 {
1295- try
1296- {
1297- document .close ();
1298- if (!currentFilePath .startsWith ("http" ))
1299- {
1300- recentFiles .addFile (currentFilePath );
1301- }
1302- recentFiles .close ();
1303- }
1304- catch ( IOException e )
1305- {
1306- // no dialogbox, don't interfere with exit wish
1307- e .printStackTrace ();
1308- }
1297+ recentFiles .addFile (currentFilePath );
13091298 }
1299+ recentFiles .close ();
13101300 windowPrefs .setExtendedState (getExtendedState ());
13111301 this .setExtendedState (Frame .NORMAL );
13121302 windowPrefs .setBounds (getBounds ());
Original file line number Diff line number Diff line change 1717package org .apache .pdfbox .debugger .ui ;
1818
1919import java .io .File ;
20- import java .io .IOException ;
2120import java .util .ArrayDeque ;
2221import java .util .ArrayList ;
2322import java .util .List ;
@@ -117,10 +116,8 @@ public List<String> getFiles()
117116 /**
118117 * This method save the present recent file history in the preference. To get the recent file
119118 * history in next session this method must be called.
120- *
121- * @throws IOException if saving in preference doesn't success.
122119 */
123- public void close () throws IOException
120+ public void close ()
124121 {
125122 writeHistoryToPref (filePaths );
126123 }
You can’t perform that action at this time.
0 commit comments