Skip to content

Commit

Permalink
8193064: JarFile::getEntry0 method reference use cause for startup re…
Browse files Browse the repository at this point in the history
…gression

Reviewed-by: sherman, mchung
  • Loading branch information
redestad committed Dec 5, 2017
1 parent d1a2b65 commit 9ebbe04
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/java.base/share/classes/java/util/jar/JarFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,12 @@
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;
Expand Down Expand Up @@ -566,7 +561,14 @@ public Stream<JarEntry> versionedStream() {
* 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) {
Expand Down

0 comments on commit 9ebbe04

Please sign in to comment.