mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8343286: Missing unchecked cast warning in polymorphic method call
Reviewed-by: mcimadamore
This commit is contained in:
parent
b80ca4902a
commit
cc2acd14b1
10 changed files with 40 additions and 2 deletions
|
@ -279,6 +279,7 @@ public class AtomicReference<V> implements java.io.Serializable {
|
|||
* @return the value
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final V getPlain() {
|
||||
return (V)VALUE.get(this);
|
||||
}
|
||||
|
@ -302,6 +303,7 @@ public class AtomicReference<V> implements java.io.Serializable {
|
|||
* @return the value
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final V getOpaque() {
|
||||
return (V)VALUE.getOpaque(this);
|
||||
}
|
||||
|
@ -324,6 +326,7 @@ public class AtomicReference<V> implements java.io.Serializable {
|
|||
* @return the value
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final V getAcquire() {
|
||||
return (V)VALUE.getAcquire(this);
|
||||
}
|
||||
|
@ -351,6 +354,7 @@ public class AtomicReference<V> implements java.io.Serializable {
|
|||
* expected value if successful
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final V compareAndExchange(V expectedValue, V newValue) {
|
||||
return (V)VALUE.compareAndExchange(this, expectedValue, newValue);
|
||||
}
|
||||
|
@ -367,6 +371,7 @@ public class AtomicReference<V> implements java.io.Serializable {
|
|||
* expected value if successful
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final V compareAndExchangeAcquire(V expectedValue, V newValue) {
|
||||
return (V)VALUE.compareAndExchangeAcquire(this, expectedValue, newValue);
|
||||
}
|
||||
|
@ -383,6 +388,7 @@ public class AtomicReference<V> implements java.io.Serializable {
|
|||
* expected value if successful
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final V compareAndExchangeRelease(V expectedValue, V newValue) {
|
||||
return (V)VALUE.compareAndExchangeRelease(this, expectedValue, newValue);
|
||||
}
|
||||
|
|
|
@ -358,6 +358,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
|
|||
* @return the value
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final E getPlain(int i) {
|
||||
return (E)AA.get(array, i);
|
||||
}
|
||||
|
@ -383,6 +384,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
|
|||
* @return the value
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final E getOpaque(int i) {
|
||||
return (E)AA.getOpaque(array, i);
|
||||
}
|
||||
|
@ -407,6 +409,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
|
|||
* @return the value
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final E getAcquire(int i) {
|
||||
return (E)AA.getAcquire(array, i);
|
||||
}
|
||||
|
@ -437,6 +440,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
|
|||
* expected value if successful
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final E compareAndExchange(int i, E expectedValue, E newValue) {
|
||||
return (E)AA.compareAndExchange(array, i, expectedValue, newValue);
|
||||
}
|
||||
|
@ -455,6 +459,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
|
|||
* expected value if successful
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final E compareAndExchangeAcquire(int i, E expectedValue, E newValue) {
|
||||
return (E)AA.compareAndExchangeAcquire(array, i, expectedValue, newValue);
|
||||
}
|
||||
|
@ -473,6 +478,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
|
|||
* expected value if successful
|
||||
* @since 9
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final E compareAndExchangeRelease(int i, E expectedValue, E newValue) {
|
||||
return (E)AA.compareAndExchangeRelease(array, i, expectedValue, newValue);
|
||||
}
|
||||
|
|
|
@ -505,6 +505,7 @@ final class ForEachOps {
|
|||
// "happens-before" completion of the associated left-most leaf task
|
||||
// of right subtree (if any, which can be this task's right sibling)
|
||||
//
|
||||
@SuppressWarnings("unchecked")
|
||||
var leftDescendant = (ForEachOrderedTask<S, T>)NEXT.getAndSet(this, null);
|
||||
if (leftDescendant != null)
|
||||
leftDescendant.tryComplete();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue