Skip to content

Commit 8b8a4ee

Browse files
committed
Polish "Make equality checks defensive to null reference"
See gh-19540
1 parent 6d8b849 commit 8b8a4ee

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public Spec<FileTreeElement> writeTo(ZipArchiveOutputStream zipOutputStream) thr
5050
getClass().getResourceAsStream("/META-INF/loader/spring-boot-loader.jar"))) {
5151
java.util.zip.ZipEntry entry = loaderJar.getNextEntry();
5252
while (entry != null) {
53-
if (entry.isDirectory() && !"META-INF/".equals(entry.getName())) {
53+
if (entry.isDirectory() && !entry.getName().equals("META-INF/")) {
5454
writeDirectory(new ZipArchiveEntry(entry), zipOutputStream);
5555
writtenDirectoriesSpec.add(entry);
5656
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,12 @@ private RenamingEntryTransformer(String namePrefix) {
369369

370370
@Override
371371
public JarArchiveEntry transform(JarArchiveEntry entry) {
372-
if ("META-INF/INDEX.LIST".equals(entry.getName())) {
372+
if (entry.getName().equals("META-INF/INDEX.LIST")) {
373373
return null;
374374
}
375-
if ((entry.getName().startsWith("META-INF/") && !"META-INF/aop.xml".equals(entry.getName())
375+
if ((entry.getName().startsWith("META-INF/") && !entry.getName().equals("META-INF/aop.xml")
376376
&& !entry.getName().endsWith(".kotlin_module")) || entry.getName().startsWith("BOOT-INF/")
377-
|| "module-info.class".equals(entry.getName())) {
377+
|| entry.getName().equals("module-info.class")) {
378378
return entry;
379379
}
380380
JarArchiveEntry renamedEntry = new JarArchiveEntry(this.namePrefix + entry.getName());

0 commit comments

Comments
 (0)