RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v6]

Tejesh R tr at openjdk.org
Mon Oct 10 16:52:48 UTC 2022


> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added.

Tejesh R has updated the pull request incrementally with one additional commit since the last revision:

  Updated based on review comments

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/10485/files
  - new: https://git.openjdk.org/jdk/pull/10485/files/11a697ea..cbc3ba1e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=04-05

  Stats: 17 lines in 1 file changed: 4 ins; 0 del; 13 mod
  Patch: https://git.openjdk.org/jdk/pull/10485.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10485/head:pull/10485

PR: https://git.openjdk.org/jdk/pull/10485



More information about the client-libs-dev mailing list