Hi Dan,
Even if the compiler does not complain, using "Class" or "Class[]" is
using a raw type and raw types should generally be viewed as
unacceptable in modern code.
Cheers,
-Joe
On 08/07/2013 11:36 AM, Dan Xu wrote:
Thanks for your review!
I was thinking of that. But without Class<?>[] on the left, the
compiler just worked fine.
Here is a simple example,
//Main.java
import java.util.*;
public class Main {
public static final Class[] TEST_CLASS = new Class<?>[16];
public static final List[] TEST_MAP = new ArrayList<?>[16];
}
After compiling with javac Xlint:all Main.java, no warnings are
printed out. Is it a compiler issue? Thanks!
-Dan
On 08/07/2013 11:11 AM, Joe Darcy wrote:
I agree with Mike; Class<?>[] should be used on both sides.
Cheers,
-Joe
On 08/07/2013 10:53 AM, Mike Duigou wrote:
Why not have Class<?>[] on the left side as well?
Mike
On Aug 7 2013, at 10:49 , Dan Xu wrote:
Hi All,
Please review the simple warning fix in
src/share/classes/sun/invoke/anon/ConstantPoolPatch.java.
webrev: http://cr.openjdk.java.net/~dxu/8022554/webrev/
Thanks,
-Dan