8193064: JarFile::getEntry0 method reference use cause for startup regression
Reviewed-by: sherman, mchung
This commit is contained in:
parent
1a819fcd7a
commit
c6aa806643
@ -43,17 +43,12 @@ import java.security.CodeSource;
|
|||||||
import java.security.cert.Certificate;
|
import java.security.cert.Certificate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Spliterator;
|
import java.util.function.Function;
|
||||||
import java.util.Spliterators;
|
|
||||||
import java.util.stream.Collector;
|
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import java.util.stream.StreamSupport;
|
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipException;
|
import java.util.zip.ZipException;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
@ -566,7 +561,14 @@ class JarFile extends ZipFile {
|
|||||||
* given entry name or {@code null} if not found.
|
* given entry name or {@code null} if not found.
|
||||||
*/
|
*/
|
||||||
private JarFileEntry getEntry0(String name) {
|
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) {
|
private String getBasename(String name) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user