build error: sun/nio/ch/Util.java ?
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Tue Oct 25 11:31:39 UTC 2011
On 25/10/11 12:22, Rémi Forax wrote:
> On 10/25/2011 12:23 PM, David Holmes wrote:
>> I'm getting a build error due to -Werror and the fact that Util.java
>> uses a raw type: "new Class[] { ...}" and so generates a raw type
>> warning
>
> Until recently, javac has forgotten to warn about that kind of rawtype
> (array of rawtype).
> new Class<?>[] { ... }
> should solve the problem.
Uhmmm, what do you mean by 'until recently' ?
With JDK 7 b147 I get the same warning with the following code:
import java.util.*;
class Test {
Object o = new ArrayList[] {};
}
output:
Test.java:4: warning: [rawtypes] found raw type: ArrayList
Object o = new ArrayList[] {};
^
missing type arguments for generic class ArrayList<E>
where E is a type-variable:
E extends Object declared in class ArrayList
1 warning
>
>>
>> David
>
> Rémi
>
More information about the core-libs-dev
mailing list