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

Jonathan Gibbons jonathan.gibbons at oracle.com
Tue Jul 24 22:39:09 UTC 2018



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
ReadAheadIterator

You've declared it to "implement Iterator<TestResult>" but I don't see 
any place where you
rely on it being a TestResult ... which is confirmed by the fact that 
you've had to newly-import
TestResult.

An arguably more abstract way of doing this would be to declare

   36 public class ReadAheadIterator<T> implements Iterator<T>

so that there is no unnecessary dependence on TestResult in this class.

The dependence on TestResult can then be expressed at the use site.

-- Jon




More information about the jtharness-dev mailing list