diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java index f604f493c7..0ebb8b0fe2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java @@ -106,11 +106,15 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter { } catch (Exception ex) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); - record(timingContext, request, response, (ex instanceof NestedServletException) ? ex.getCause() : ex); + record(timingContext, request, response, unwrapNestedServletException(ex)); throw ex; } } + private Throwable unwrapNestedServletException(Throwable ex) { + return (ex instanceof NestedServletException) ? ex.getCause() : ex; + } + private TimingContext startAndAttachTimingContext(HttpServletRequest request) { Timer.Sample timerSample = Timer.start(this.registry); TimingContext timingContext = new TimingContext(timerSample); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java index edc7913307..ac27210124 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java @@ -34,9 +34,9 @@ import org.springframework.boot.loader.data.RandomAccessData; /** * Provides access to entries from a {@link JarFile}. In order to reduce memory - * consumption entry details are stored using int arrays. The {@code hashCodes} array - * stores the hash code of the entry name, the {@code centralDirectoryOffsets} provides - * the offset to the central directory record and {@code positions} provides the original + * consumption entry details are stored using arrays. The {@code hashCodes} array stores + * the hash code of the entry name, the {@code centralDirectoryOffsets} provides the + * offset to the central directory record and {@code positions} provides the original * order position of the entry. The arrays are stored in hashCode order so that a binary * search can be used to find a name. *
@@ -120,7 +120,7 @@ class JarFileEntries implements CentralDirectoryVisitor, Iterable