reopen JDK-8063054?

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Nov 23 11:11:06 UTC 2016


I'm seeing the warnings myself - Vicente can you take another look?

Maurizio


On 23/11/16 03:34, Liam Miller-Cushon wrote:
> JDK-8063054 was marked 'cannot reproduce', but I'm still seeing this 
> issue with 9-ea+145:
>
> $ cat Test.java
> class Test {
>   void test(Box<? extends Box<Number>> b) {
>     Number n = b.<Number>map(Box::get).get();
>   }
> }
>
> interface Func<S,T> { T apply(S arg); }
>
> interface Box<T> {
>   T get();
>   <R> Box<R> map(Func<T,R> f);
> }
> $ javac -Xlint:rawtypes Test.java
> Test.java:3: warning: [rawtypes] found raw type: Box
>     Number n = b.<Number>map(Box::get).get();
>                              ^
>   missing type arguments for generic class Box<T>
>   where T is a type-variable:
>     T extends Object declared in interface Box
> 1 warning
>
> $ cat Test.java
> interface Consumer<T> { void accept(T arg); }
> interface Parent<P> { void foo(); }
> interface Child extends Parent<String> {}
>
> class Test {
>   static <T> void m(T arg, Consumer<T> f) {}
>
>   public void test(Child c) { m(c, Parent::foo); }
> }
> $ javac -Xlint:rawtypes Test.java
> Test.java:8: warning: [rawtypes] found raw type: Parent
>   public void test(Child c) { m(c, Parent::foo); }
>                                    ^
>   missing type arguments for generic class Parent<P>
>   where P is a type-variable:
>     P extends Object declared in interface Parent
> 1 warning



More information about the compiler-dev mailing list