Skip to content

Commit 9540905

Browse files
committed
Merge branch '2.1.x'
2 parents ff6ef1e + 68e3de0 commit 9540905

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 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.
@@ -34,6 +34,8 @@ class JarEntry extends java.util.jar.JarEntry implements FileHeader {
3434

3535
private final AsciiBytes name;
3636

37+
private final AsciiBytes headerName;
38+
3739
private Certificate[] certificates;
3840

3941
private CodeSigner[] codeSigners;
@@ -45,6 +47,7 @@ class JarEntry extends java.util.jar.JarEntry implements FileHeader {
4547
JarEntry(JarFile jarFile, CentralDirectoryFileHeader header, AsciiBytes nameAlias) {
4648
super((nameAlias != null) ? nameAlias.toString() : header.getName().toString());
4749
this.name = (nameAlias != null) ? nameAlias : header.getName();
50+
this.headerName = header.getName();
4851
this.jarFile = jarFile;
4952
this.localHeaderOffset = header.getLocalHeaderOffset();
5053
setCompressedSize(header.getCompressedSize());
@@ -62,7 +65,7 @@ AsciiBytes getAsciiBytesName() {
6265

6366
@Override
6467
public boolean hasName(CharSequence name, char suffix) {
65-
return this.name.matches(name, suffix);
68+
return this.headerName.matches(name, suffix);
6669
}
6770

6871
/**

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ private <T extends FileHeader> T getEntry(int hashCode, CharSequence name,
305305
int index = getFirstIndex(hashCode);
306306
while (index >= 0 && index < this.size && this.hashCodes[index] == hashCode) {
307307
T entry = getEntry(index, type, cacheEntry, nameAlias);
308-
if (entry.hasName((nameAlias != null) ? nameAlias.toString() : name,
309-
suffix)) {
308+
if (entry.hasName(name, suffix)) {
310309
return entry;
311310
}
312311
index++;

0 commit comments

Comments
 (0)