Browse Source

Polish "Make equality checks defensive to null reference"

See gh-19540
pull/19905/head
Stephane Nicoll 6 years ago
parent
commit
8b8a4ee65e
  1. 2
      spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/util/ResourceUtils.java
  2. 2
      spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsWebTestClientBuilderCustomizer.java
  3. 2
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LoaderZipEntries.java
  4. 6
      spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java

2
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/util/ResourceUtils.java

@ -1,5 +1,5 @@ @@ -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.

2
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsWebTestClientBuilderCustomizer.java

@ -1,5 +1,5 @@ @@ -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.

2
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LoaderZipEntries.java

@ -50,7 +50,7 @@ class LoaderZipEntries { @@ -50,7 +50,7 @@ class LoaderZipEntries {
getClass().getResourceAsStream("/META-INF/loader/spring-boot-loader.jar"))) {
java.util.zip.ZipEntry entry = loaderJar.getNextEntry();
while (entry != null) {
if (entry.isDirectory() && !"META-INF/".equals(entry.getName())) {
if (entry.isDirectory() && !entry.getName().equals("META-INF/")) {
writeDirectory(new ZipArchiveEntry(entry), zipOutputStream);
writtenDirectoriesSpec.add(entry);
}

6
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java

@ -369,12 +369,12 @@ public class Repackager { @@ -369,12 +369,12 @@ public class Repackager {
@Override
public JarArchiveEntry transform(JarArchiveEntry entry) {
if ("META-INF/INDEX.LIST".equals(entry.getName())) {
if (entry.getName().equals("META-INF/INDEX.LIST")) {
return null;
}
if ((entry.getName().startsWith("META-INF/") && !"META-INF/aop.xml".equals(entry.getName())
if ((entry.getName().startsWith("META-INF/") && !entry.getName().equals("META-INF/aop.xml")
&& !entry.getName().endsWith(".kotlin_module")) || entry.getName().startsWith("BOOT-INF/")
|| "module-info.class".equals(entry.getName())) {
|| entry.getName().equals("module-info.class")) {
return entry;
}
JarArchiveEntry renamedEntry = new JarArchiveEntry(this.namePrefix + entry.getName());

Loading…
Cancel
Save