Polish "Make equality checks defensive to null reference"

See gh-19540
pull/19905/head
Stephane Nicoll 5 years ago
parent 6d8b849361
commit 8b8a4ee65e

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

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

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

Loading…
Cancel
Save