8141368: Typo in java/lang/Class/IsEnum.java test
Reviewed-by: jjg
This commit is contained in:
parent
c0215a77a2
commit
03a416db62
@ -32,8 +32,8 @@ import java.lang.annotation.*;
|
||||
|
||||
public class IsEnum {
|
||||
|
||||
static int test(Class clazz, boolean expected) {
|
||||
int status = (clazz.isEnum() == expected)?0:1;
|
||||
static int test(Class<?> clazz, boolean expected) {
|
||||
int status = (clazz.isEnum() == expected) ? 0 : 1;
|
||||
|
||||
if (status == 1) {
|
||||
System.err.println("Unexpected enum status for " + clazz);
|
||||
@ -41,23 +41,23 @@ public class IsEnum {
|
||||
return status;
|
||||
}
|
||||
|
||||
public static void main(String argv[]) {
|
||||
public static void main(String... argv) {
|
||||
int failures = 0;
|
||||
|
||||
failures += test(IsEnum.class, false);
|
||||
failures += test(String.class, false);
|
||||
failures += test(Enum.class, false);
|
||||
failures += test(EnumPoseur.class, false);
|
||||
failures += test(java.math.RoundingMode.class, true);
|
||||
|
||||
// Classes in java.lang.annoation
|
||||
// Classes in java.lang.annotation
|
||||
failures += test(Annotation.class, false);
|
||||
failures += test(ElementType.class, true);
|
||||
failures += test(Retention.class, false);
|
||||
failures += test(RetentionPolicy.class, true);
|
||||
failures += test(Target.class, false);
|
||||
failures += test(EnumPoseur.class, false);
|
||||
|
||||
// Classes for specialized enum constants aren't enum's
|
||||
// A class for a specialized enum constant isn't itself an enum
|
||||
failures += test(SpecialEnum.class, true);
|
||||
failures += test(SpecialEnum.RED.getClass(), false);
|
||||
failures += test(SpecialEnum.GREEN.getClass(), true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user