Commit 8b8a4ee6 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Make equality checks defensive to null reference"

See gh-19540
parent 6d8b8493
/* /*
* 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.
......
/* /*
* 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 { ...@@ -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 { ...@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment