mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +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
|
@ -295,14 +295,10 @@ public final class OptionalDouble {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!(obj instanceof OptionalDouble)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
OptionalDouble other = (OptionalDouble) obj;
|
||||
return (isPresent && other.isPresent)
|
||||
? Double.compare(value, other.value) == 0
|
||||
: isPresent == other.isPresent;
|
||||
return obj instanceof OptionalDouble other
|
||||
&& (isPresent && other.isPresent
|
||||
? Double.compare(value, other.value) == 0
|
||||
: isPresent == other.isPresent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue