From 1640add8be41db349b4cc22bd38d9320b9bb9b9e Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 7 Apr 2020 12:09:43 -0700 Subject: [PATCH] Don't use Assert class from loader Remove the use of `Assert` since it's unavailable that early. --- .../springframework/boot/loader/ClassPathIndexFile.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ClassPathIndexFile.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ClassPathIndexFile.java index dab893b5d5a..f3deb7b0d7d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ClassPathIndexFile.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ClassPathIndexFile.java @@ -31,8 +31,6 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import org.springframework.util.Assert; - /** * A class path index file that provides ordering information for JARs. * @@ -51,8 +49,10 @@ final class ClassPathIndexFile { } private String extractName(String line) { - Assert.state(line.startsWith("- \"") && line.endsWith("\""), "Malformed classpath index line [" + line + "]"); - return line.substring(3, line.length() - 1); + if (line.startsWith("- \"") && line.endsWith("\"")) { + return line.substring(3, line.length() - 1); + } + throw new IllegalStateException("Malformed classpath index line [" + line + "]"); } int size() {