mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +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
|
@ -2664,9 +2664,8 @@ public final class Scanner implements Iterator<String>, Closeable {
|
|||
*/
|
||||
public BigInteger nextBigInteger(int radix) {
|
||||
// Check cached result
|
||||
if ((typeCache != null) && (typeCache instanceof BigInteger)
|
||||
if ((typeCache != null) && (typeCache instanceof BigInteger val)
|
||||
&& this.radix == radix) {
|
||||
BigInteger val = (BigInteger)typeCache;
|
||||
useTypeCache();
|
||||
return val;
|
||||
}
|
||||
|
@ -2730,8 +2729,7 @@ public final class Scanner implements Iterator<String>, Closeable {
|
|||
*/
|
||||
public BigDecimal nextBigDecimal() {
|
||||
// Check cached result
|
||||
if ((typeCache != null) && (typeCache instanceof BigDecimal)) {
|
||||
BigDecimal val = (BigDecimal)typeCache;
|
||||
if ((typeCache != null) && (typeCache instanceof BigDecimal val)) {
|
||||
useTypeCache();
|
||||
return val;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue