7116404: Miscellaneous warnings (java.rmi.**, serialization, some core classes)

Rémi Forax forax at univ-mlv.fr
Wed Nov 30 15:06:15 UTC 2011


On 11/30/2011 11:00 AM, Alan Bateman wrote:
> On 29/11/2011 23:01, Stuart Marks wrote:
>> On 11/29/11 8:10 AM, Alan Bateman wrote:
>>> :
>>>
>>> http://cr.openjdk.java.net/~alanb/7116404/webrev/
>>
>> Wow, you're getting a jump on us! Any idea how many warnings this 
>> cleared up? Looks like dozens.
> 110, so not too many. There is still plenty of low hanging cider for 
> everyone.
>
>
>> :
>> A couple comments on these:
>>
>> * The ObjectInputStream.readEnum case does indeed look tricky and so 
>> use of @SuppressWarnings is probably called for. Is it possible to 
>> use this annotation in a smaller scope than the entire method? 
> That's a good point, I've changed ObjectInputStream.readEnum and 
> MarshalledObject.get so that that the @SuppressWarnings is at the 
> declaration so it reduces its scope. The webrev is updated. I'll try 
> to push this today before tomorrow's storm.

Note that you can use clazz.asSubclass(Enum.class) instead of casting to 
the raw type Class,
you will still have a warning but you will be not the one that have 
introduced a raw type :)

>
> -Alan.
>

Rémi




More information about the core-libs-dev mailing list