Skip to content
Permalink
Browse files

Catching InvalidPathException on creating history menu items

- InvalidPathException occurs, if the history file contains invalid path
characters (e.g. ?)
- exception handling was improved to the general case, see
https://software.applied-geodesy.org/forum/?id=129
  • Loading branch information...
loesler committed Jun 20, 2018
1 parent 1155606 commit b5f2d9a2e71dd3a00e61297e88d669f2fa7ca4cb
Showing with 6 additions and 7 deletions.
  1. +6 −7 JAG3D/src/org/applied_geodesy/jag3d/ui/menu/UIMenuBuilder.java
@@ -302,10 +302,9 @@ private void writeProjectHistory() {
pw.printf(Locale.ENGLISH, "%s\r\n", fileMenuItem.getFile());
}
}
} catch (IOException e) {
} catch (Exception e) {
e.printStackTrace();
}
finally {
} finally {
if (pw != null)
pw.close();
}
@@ -345,7 +344,7 @@ private void addHistoryFile(File file) {
this.historyMenu.setDisable(items.isEmpty());
this.writeProjectHistory();

} catch (IOException e) {
} catch (Exception e) {
e.printStackTrace();
}
}
@@ -383,13 +382,13 @@ private Menu createHistoryMenu() {
break;
}
}
this.historyMenu.setDisable(newItems.isEmpty());

} catch (IOException e) {
} catch (Exception e) {
e.printStackTrace();
newItems.clear();
} finally {
if (scanner != null)
scanner.close();
this.historyMenu.setDisable(newItems.isEmpty());
}
}
return this.historyMenu;

0 comments on commit b5f2d9a

Please sign in to comment.
You can’t perform that action at this time.