JDK 9 RFR of JDK-8049820: Fix raw and unchecked lint warnings in sun.management
Joe Darcy
joe.darcy at oracle.com
Thu Jul 10 04:25:26 UTC 2014
PS Upon double-checking, I neglected to include the changes to one other
file in my earlier review request:
--- a/src/share/classes/sun/management/GcInfoBuilder.java Thu Jul 10
03:07:48 2014 +0000
+++ b/src/share/classes/sun/management/GcInfoBuilder.java Wed Jul 09
21:24:03 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights
reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -98,7 +98,7 @@
// First, fill with the attributes in the GcInfo
String[] gcInfoItemNames =
GcInfoCompositeData.getBaseGcInfoItemNames();
- OpenType[] gcInfoItemTypes =
GcInfoCompositeData.getBaseGcInfoItemTypes();
+ OpenType<?>[] gcInfoItemTypes =
GcInfoCompositeData.getBaseGcInfoItemTypes();
int numGcInfoItems = gcInfoItemNames.length;
int itemCount = numGcInfoItems + gcExtItemCount;
I'll include this straightforward change in the push.
Thanks,
-Joe
On 07/09/2014 07:40 PM, Mandy Chung wrote:
>
> On 7/9/2014 6:35 PM, Joe Darcy wrote:
>> Hi Mandy,
>>
>> On 07/09/2014 06:26 PM, Mandy Chung wrote:
>>>
>>> On 7/9/2014 6:10 PM, Joe Darcy wrote:
>>>> Hello,
>>>>
>>>> Another batch of lint warnings removal; this time for
>>>>
>>>> 8049820: Fix raw and unchecked lint warnings in sun.management
>>>> http://cr.openjdk.java.net/~darcy/8049820.0/
>>>
>>> 230 @SuppressWarnings("rawtypes")
>>> 231 final Class enumClass;
>>>
>>> Why can't the enumClass field be declared of Class<?> type?
>>>
>>> Other than that, looks fine.
>>> Mandy
>>>
>>
>> My first attempt at generifying this class used Class<?> as you
>> suggest. The problem occurs in the call to the static method
>> Enum.valueOf which has a declaration of
>>
>> public static <T extends Enum<T>> T valueOf(Class<T> enumType,
>> String name)
>>
>> The problem here is the recursive "T extends Enum<T>", following the
>> recursive F-bound of the java.lang.Enum type itself. Using a wildcard
>> for Class<?> doesn't work with this method signature; something like
>> Class<? extends Enum> doesn't work either because the more specific
>> recursive binding is not captured, so I reluctantly fell back to
>> using a raw type.
>
> I see, thanks. The patch is good to go.
> Mandy
>
More information about the serviceability-dev
mailing list