Skip to content

Commit 23e87f8

Browse files
dreis2211wilkinsona
authored andcommitted
Treat Java 11+'s NoSuchFileException the same as FileNotFoundException
See gh-19850
1 parent adc6444 commit 23e87f8

File tree

1 file changed

+2
-1
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-layertools/src/main/java/org/springframework/boot/layertools

1 file changed

+2
-1
lines changed

spring-boot-project/spring-boot-tools/spring-boot-layertools/src/main/java/org/springframework/boot/layertools/IndexedLayers.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.io.FileNotFoundException;
2020
import java.io.IOException;
2121
import java.nio.charset.StandardCharsets;
22+
import java.nio.file.NoSuchFileException;
2223
import java.util.ArrayList;
2324
import java.util.Arrays;
2425
import java.util.Iterator;
@@ -91,7 +92,7 @@ static IndexedLayers get(Context context) {
9192
}
9293
return null;
9394
}
94-
catch (FileNotFoundException ex) {
95+
catch (FileNotFoundException | NoSuchFileException ex) {
9596
return null;
9697
}
9798
catch (IOException ex) {

0 commit comments

Comments
 (0)