mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8263190: Update java.io, java.math, and java.text to use instanceof pattern variable
Reviewed-by: lancea, bpb, darcy, naoto, iris, dfuchs, smarks, redestad
This commit is contained in:
parent
4f0a12ec87
commit
0f2402d0a2
15 changed files with 32 additions and 59 deletions
|
@ -2400,8 +2400,7 @@ public class ObjectStreamClass implements Serializable {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (obj instanceof FieldReflectorKey) {
|
||||
FieldReflectorKey other = (FieldReflectorKey) obj;
|
||||
if (obj instanceof FieldReflectorKey other) {
|
||||
Class<?> referent;
|
||||
return (nullClass ? other.nullClass
|
||||
: ((referent = get()) != null) &&
|
||||
|
@ -2597,8 +2596,7 @@ public class ObjectStreamClass implements Serializable {
|
|||
|
||||
@Override
|
||||
public final boolean equals(Object obj) {
|
||||
if (!(obj instanceof Key)) return false;
|
||||
Key other = (Key) obj;
|
||||
if (!(obj instanceof Key other)) return false;
|
||||
int n = length();
|
||||
if (n != other.length()) return false;
|
||||
for (int i = 0; i < n; i++) if (fieldType(i) != other.fieldType(i)) return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue