On Wed, 29 Jun 2022 13:06:21 GMT, Abhishek Kumar <d...@openjdk.org> wrote:
> JFileChooser - empty file size issue fixed. > For empty file, now the size 0 bytes. > Manual Test Case "ZeroFileSizeCheck.java" created. Changes requested by aivanov (Reviewer). test/jdk/javax/swing/JFileChooser/ZeroFileSizeCheck.java line 56: > 54: JFileChooser fc = new JFileChooser(); > 55: try { > 56: Path currentDir = > Paths.get(System.getProperty("java.io.tmpdir")); Why not create it in the `test.src` value? This property is defined by jtreg. If the property is not set, default to `.`, that is the current directory. test/jdk/javax/swing/JFileChooser/ZeroFileSizeCheck.java line 66: > 64: throw new RuntimeException(ex); > 65: } > 66: frame.getContentPane().add(fc); Usually, you don't add [`JFileChooser`](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/JFileChooser.html) to a container but rather use it as a dialog box: int returnVal = chooser.showOpenDialog(parent); where `parent` is the parent of the created `JDialog`. However, it's basically what's done in `showDialog` / `createDialog` methods. https://github.com/openjdk/jdk/blob/ec4fb47b90c9737dfdc285ebe98367a221c90c79/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L823-L825 ------------- PR: https://git.openjdk.org/jdk/pull/9327