mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8267110: Update java.util to use instanceof pattern variable
Reviewed-by: lancea, naoto
This commit is contained in:
parent
0a03fc84b3
commit
a52c4ede2f
29 changed files with 142 additions and 266 deletions
|
@ -514,12 +514,8 @@ public class Attributes implements Map<Object,Object>, Cloneable {
|
|||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o instanceof Name) {
|
||||
Name other = (Name)o;
|
||||
return other.name.equalsIgnoreCase(name);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return o instanceof Name other
|
||||
&& other.name.equalsIgnoreCase(name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -551,10 +551,9 @@ class JarVerifier {
|
|||
* Match CodeSource to a CodeSigner[] in the signer cache.
|
||||
*/
|
||||
private CodeSigner[] findMatchingSigners(CodeSource cs) {
|
||||
if (cs instanceof VerifierCodeSource) {
|
||||
VerifierCodeSource vcs = (VerifierCodeSource) cs;
|
||||
if (cs instanceof VerifierCodeSource vcs) {
|
||||
if (vcs.isSameDomain(csdomain)) {
|
||||
return ((VerifierCodeSource) cs).getPrivateSigners();
|
||||
return vcs.getPrivateSigners();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -617,8 +616,7 @@ class JarVerifier {
|
|||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (obj instanceof VerifierCodeSource) {
|
||||
VerifierCodeSource that = (VerifierCodeSource) obj;
|
||||
if (obj instanceof VerifierCodeSource that) {
|
||||
|
||||
/*
|
||||
* Only compare against other per-signer singletons constructed
|
||||
|
|
|
@ -379,13 +379,9 @@ public class Manifest implements Cloneable {
|
|||
* the same main Attributes and entries
|
||||
*/
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof Manifest) {
|
||||
Manifest m = (Manifest)o;
|
||||
return attr.equals(m.getMainAttributes()) &&
|
||||
entries.equals(m.getEntries());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return o instanceof Manifest m
|
||||
&& attr.equals(m.getMainAttributes())
|
||||
&& entries.equals(m.getEntries());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue