8342865: Use type parameter for Class::getPrimitiveClass

Reviewed-by: darcy
This commit is contained in:
Chen Liang 2024-10-26 14:45:04 +00:00
parent 9e451aa365
commit 40e07a7ea3
10 changed files with 13 additions and 22 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2024, 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
@ -39,8 +39,7 @@ class Void {
* The {@code Class} object representing the pseudo-type corresponding to
* the keyword {@code void}.
*/
@SuppressWarnings("unchecked")
public static final Class<Void> TYPE = (Class<Void>) Class.getPrimitiveClass("void");
public static final Class<Void> TYPE = Class.getPrimitiveClass("void");
/*
* The Void class cannot be instantiated.