mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8193064: JarFile::getEntry0 method reference use cause for startup regression
Reviewed-by: sherman, mchung
This commit is contained in:
parent
1a819fcd7a
commit
c6aa806643
1 changed files with 9 additions and 7 deletions
|
@ -43,17 +43,12 @@ import java.security.CodeSource;
|
|||
import java.security.cert.Certificate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Objects;
|
||||
import java.util.Spliterator;
|
||||
import java.util.Spliterators;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.stream.StreamSupport;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipException;
|
||||
import java.util.zip.ZipFile;
|
||||
|
@ -566,7 +561,14 @@ class JarFile extends ZipFile {
|
|||
* given entry name or {@code null} if not found.
|
||||
*/
|
||||
private JarFileEntry getEntry0(String name) {
|
||||
return (JarFileEntry)JUZFA.getEntry(this, name, JarFileEntry::new);
|
||||
// Not using a lambda/method reference here to optimize startup time
|
||||
Function<String, JarEntry> newJarFileEntryFn = new Function<>() {
|
||||
@Override
|
||||
public JarEntry apply(String name) {
|
||||
return new JarFileEntry(name);
|
||||
}
|
||||
};
|
||||
return (JarFileEntry)JUZFA.getEntry(this, name, newJarFileEntryFn);
|
||||
}
|
||||
|
||||
private String getBasename(String name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue