On Thu, 31 Aug 2023 15:30:01 GMT, Tejesh R <t...@openjdk.org> wrote: >> test/jdk/javax/swing/JFileChooser/FileChooserNewFolderLocaleTest.java line >> 77: >> >>> 75: System.out.println("Failed to delete file : " + >>> 76: newFolderEnglish.getName()); >>> 77: } >> >> It's a bit on the overthinking side yet you use the same code for both >> `newFolderEnglish` and `newFolderFrench`. A helper method to remove the >> folder and to print an error message would eliminate the duplicate code. > > Helper method meaning what I have done right?
Yes, a helper method which deletes a directory that you pass as a parameter and prints an error if it fails. Then removing the two directories is a matter of calling this method twice: for the English and French directory. You just got the condition wrong, it seems. The one you used previously looked correct. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15069#discussion_r1311832540