mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8202719: Use Collections.emptyEnumeration where possible
Reviewed-by: martin, psandoz
This commit is contained in:
parent
13ce1152a4
commit
59d4a62f42
2 changed files with 3 additions and 21 deletions
|
@ -42,6 +42,7 @@ import java.security.CodeSigner;
|
|||
import java.security.CodeSource;
|
||||
import java.security.cert.Certificate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
@ -1095,16 +1096,7 @@ class JarFile extends ZipFile {
|
|||
if (includeUnsigned) {
|
||||
return unsignedEntryNames();
|
||||
} else {
|
||||
return new Enumeration<>() {
|
||||
|
||||
public boolean hasMoreElements() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String nextElement() {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
};
|
||||
return Collections.emptyEnumeration();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -684,7 +684,7 @@ class JarVerifier {
|
|||
}
|
||||
|
||||
final List<CodeSigner[]> signersReq = req;
|
||||
final Enumeration<String> enum2 = (matchUnsigned) ? unsignedEntryNames(jar) : emptyEnumeration;
|
||||
final Enumeration<String> enum2 = matchUnsigned ? unsignedEntryNames(jar) : Collections.emptyEnumeration();
|
||||
|
||||
return new Enumeration<>() {
|
||||
|
||||
|
@ -769,16 +769,6 @@ class JarVerifier {
|
|||
}
|
||||
};
|
||||
}
|
||||
private Enumeration<String> emptyEnumeration = new Enumeration<String>() {
|
||||
|
||||
public boolean hasMoreElements() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String nextElement() {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
};
|
||||
|
||||
// true if file is part of the signature mechanism itself
|
||||
static boolean isSigningRelated(String name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue