mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8274835: Remove unnecessary castings in java.base
Reviewed-by: mullan, naoto, lancea, bpb
This commit is contained in:
parent
3b2585c02b
commit
5a2452c80e
15 changed files with 32 additions and 35 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -685,7 +685,7 @@ public abstract class ClassValue<T> {
|
|||
if (haveReplacement >= 0) {
|
||||
if (cache[(replacementPos+1) & mask] != null) {
|
||||
// Be conservative, to avoid breaking up a non-null run.
|
||||
cache[replacementPos & mask] = (Entry<?>) Entry.DEAD_ENTRY;
|
||||
cache[replacementPos & mask] = Entry.DEAD_ENTRY;
|
||||
} else {
|
||||
cache[replacementPos & mask] = null;
|
||||
cacheLoad -= 1;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -193,7 +193,7 @@ public abstract class Enum<E extends Enum<E>>
|
|||
* method is the order in which the constants are declared.
|
||||
*/
|
||||
public final int compareTo(E o) {
|
||||
Enum<?> other = (Enum<?>)o;
|
||||
Enum<?> other = o;
|
||||
Enum<E> self = this;
|
||||
if (self.getClass() != other.getClass() && // optimization
|
||||
self.getDeclaringClass() != other.getDeclaringClass())
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -443,7 +443,7 @@ public final class StackTraceElement implements java.io.Serializable {
|
|||
*/
|
||||
private synchronized void computeFormat() {
|
||||
try {
|
||||
Class<?> cls = (Class<?>) declaringClassObject;
|
||||
Class<?> cls = declaringClassObject;
|
||||
ClassLoader loader = cls.getClassLoader0();
|
||||
Module m = cls.getModule();
|
||||
byte bits = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue