From 23e87f8266a8e1c790f49c632822d273e3996ee6 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Wed, 22 Jan 2020 11:10:40 +0100 Subject: [PATCH] Treat Java 11+'s NoSuchFileException the same as FileNotFoundException See gh-19850 --- .../org/springframework/boot/layertools/IndexedLayers.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-layertools/src/main/java/org/springframework/boot/layertools/IndexedLayers.java b/spring-boot-project/spring-boot-tools/spring-boot-layertools/src/main/java/org/springframework/boot/layertools/IndexedLayers.java index 582e6d349a..60c404bb1f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-layertools/src/main/java/org/springframework/boot/layertools/IndexedLayers.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-layertools/src/main/java/org/springframework/boot/layertools/IndexedLayers.java @@ -19,6 +19,7 @@ package org.springframework.boot.layertools; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.nio.file.NoSuchFileException; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -91,7 +92,7 @@ class IndexedLayers implements Layers { } return null; } - catch (FileNotFoundException ex) { + catch (FileNotFoundException | NoSuchFileException ex) { return null; } catch (IOException ex) {