From e74f777971c48f06c9916d7f109b757e52458c08 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Sat, 26 Sep 2020 09:11:05 +0100 Subject: [PATCH] Remove use of spring-core's Assert from PropertiesLauncher Fixes gh-23474 --- .../spring-boot-tools/spring-boot-loader/pom.xml | 7 +------ .../springframework/boot/loader/PropertiesLauncher.java | 7 ++++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml index e8c17f65c8f..8f1a4a23526 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml @@ -19,12 +19,7 @@ ${git.developerConnection} - - - org.springframework - spring-core - true - + org.springframework.boot diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java index 75e48d507eb..9ee9ad112b2 100755 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,6 @@ import org.springframework.boot.loader.archive.Archive.EntryFilter; import org.springframework.boot.loader.archive.ExplodedArchive; import org.springframework.boot.loader.archive.JarFileArchive; import org.springframework.boot.loader.util.SystemPropertyUtils; -import org.springframework.util.Assert; /** * {@link Launcher} for archives with user-configured classpath and main class via a @@ -370,7 +369,9 @@ public class PropertiesLauncher extends Launcher { if (classLoader == null) { classLoader = newClassLoader(type, NO_PARAMS); } - Assert.notNull(classLoader, "Unable to create class loader for " + className); + if (classLoader == null) { + throw new IllegalArgumentException("Unable to create class loader for " + className); + } return classLoader; }