RFR: CODETOOLS-7902237: Fixing raw use of parameterized class

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Jul 25 16:46:35 UTC 2018


Yes, I saw this, after reading more of the review.

One solution would be to have two different methods, with different 
return types.

-- Jon


On 7/25/18 6:13 AM, dmitry.bessonov at oracle.com wrote:
>
>
> On 24/07/2018 22:14, Jonathan Gibbons wrote:
>>
>>
>> On 07/24/2018 07:48 AM, dmitry.bessonov at oracle.com wrote:
>>> Please review the following fix related to "raw use of parameterized 
>>> class" warning:
>>>
>>> JBS: https://bugs.openjdk.java.net/browse/CODETOOLS-7902237
>>> Webrev: http://cr.openjdk.java.net/~dbessono/7902237/webrev/
>>>
>>> dmitry
>>
>>   386             for (Iterator<?> iter = other.getIterator(false); 
>> iter.hasNext(); ) {
>>   387                 Entry otherEntry = (Entry) (iter.next());
>>
>> can be
>>
>>   386             for (Iterator<Entry> iter = 
>> other.getIterator(false); iter.hasNext(); ) {
>>   387                 Entry otherEntry = iter.next();
>>
>> although, is it guaranteed that the iterator always returns Entry 
>> objects?  (Never Entry[]?)
>
> No it is not guaranteed.
> The way ExcludeList.getIterator() method was designed assumes that it 
> could return an iterator over arrays if entries.
>
> dmitry
>
>
>>
>> -- Jon



More information about the jtharness-dev mailing list