Tweaks to r1590, mostly formatting.

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1605 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/JClassLiteral.java b/dev/core/src/com/google/gwt/dev/jjs/ast/JClassLiteral.java
index ff8a95e..eb97f67 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/ast/JClassLiteral.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/ast/JClassLiteral.java
@@ -54,32 +54,31 @@
 
     JMethod method = program.getIndexedMethod(type.getClassLiteralFactoryMethod());
     assert method != null;
-    
+
     JMethodCall call = new JMethodCall(program, null, null, method);
     call.getArgs().add(program.getLiteralString(getPackageName(typeName)));
     call.getArgs().add(program.getLiteralString(getClassName(typeName)));
-    
+
     if (type instanceof JClassType && !(type instanceof JArrayType)) {
       /*
-       * For non-array classes and enums, determine the class literal of the 
-       * supertype, if there is one.  Arrays are excluded because they always
+       * For non-array classes and enums, determine the class literal of the
+       * supertype, if there is one. Arrays are excluded because they always
        * have Object as their superclass.
        */
       assert (type instanceof JClassType);
       JClassType classType = (JClassType) type;
 
       JLiteral superclassLiteral;
-      
+
       if (classType.extnds != null) {
         superclassLiteral = program.getLiteralClass(classType.extnds);
       } else {
         superclassLiteral = program.getLiteralNull();
       }
-      
+
       call.getArgs().add(superclassLiteral);
     } else {
-      assert (type instanceof JArrayType || type instanceof JInterfaceType || 
-          type instanceof JPrimitiveType);
+      assert (type instanceof JArrayType || type instanceof JInterfaceType || type instanceof JPrimitiveType);
     }
 
     classObjectAllocation = call;
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
index eaa2eb9..420c4fc 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
@@ -1167,17 +1167,17 @@
 
       if (type instanceof JClassType && !(type instanceof JArrayType)) {
         /*
-         * If this type is a regular class or an enum, then ensure that its 
-         * superclasses' class literal is generated before its own.
+         * If this type is a regular class or an enum, then ensure that its
+         * superclass's class literal is generated before its own.
          * 
-         * NOTE: JInterfaceTypes can have their JReferenceType.extnds member
-         * set to its first implemented interface.  JArrayTypes always have
-         * Object as their superclass so there is no need to explicitly set it
-         * here.
+         * NOTE: JInterfaceTypes can have their JReferenceType.extnds member set
+         * to its first implemented interface. JArrayTypes always have Object as
+         * their superclass so there is no need to explicitly set it here.
          */
         JClassType classType = (JClassType) type;
         if (classType.extnds != null) {
-          generateClassLiteralsRecursive(alreadyGenerated, classType.extnds, vars);
+          generateClassLiteralsRecursive(alreadyGenerated, classType.extnds,
+              vars);
         }
       }
 
@@ -1507,7 +1507,7 @@
     public void endVisit(JsniMethodRef x, Context ctx) {
       endVisit((JMethodCall) x, ctx);
     }
-    
+
     @Override
     public boolean visit(JMethod x, Context ctx) {
       currentMethod = x;
diff --git a/user/super/com/google/gwt/emul/java/lang/Class.java b/user/super/com/google/gwt/emul/java/lang/Class.java
index 2f5876a..faad204 100644
--- a/user/super/com/google/gwt/emul/java/lang/Class.java
+++ b/user/super/com/google/gwt/emul/java/lang/Class.java
@@ -33,9 +33,9 @@
    * 
    * @skip
    */
-  static Class<?> createForArray(String packageName, String className) {
+  static <T> Class<T> createForArray(String packageName, String className) {
     // Initialize here to avoid method inliner
-    Class<?> clazz = new Class();
+    Class<T> clazz = new Class<T>();
     clazz.typeName = packageName + className;
     clazz.modifiers = ARRAY;
     clazz.superclass = Object.class;
@@ -47,9 +47,10 @@
    * 
    * @skip
    */
-  static Class<?> createForClass(String packageName, String className, Class<?> superclass) {
+  static <T> Class<T> createForClass(String packageName, String className,
+      Class<? super T> superclass) {
     // Initialize here to avoid method inliner
-    Class<?> clazz = new Class<Object>();
+    Class<T> clazz = new Class<T>();
     clazz.typeName = packageName + className;
     clazz.superclass = superclass;
     return clazz;
@@ -60,9 +61,10 @@
    * 
    * @skip
    */
-  static Class<?> createForEnum(String packageName, String className, Class<?> superclass) {
+  static <T> Class<T> createForEnum(String packageName, String className,
+      Class<? super T> superclass) {
     // Initialize here to avoid method inliner
-    Class<?> clazz = new Class<Object>();
+    Class<T> clazz = new Class<T>();
     clazz.typeName = packageName + className;
     clazz.modifiers = ENUM;
     clazz.superclass = superclass;
@@ -74,9 +76,9 @@
    * 
    * @skip
    */
-  static Class<?> createForInterface(String packageName, String className) {
+  static <T> Class<T> createForInterface(String packageName, String className) {
     // Initialize here to avoid method inliner
-    Class<?> clazz = new Class<Object>();
+    Class<T> clazz = new Class<T>();
     clazz.typeName = packageName + className;
     clazz.modifiers = INTERFACE;
     return clazz;
@@ -99,8 +101,8 @@
 
   private String typeName;
 
-  private Class<?> superclass;
-  
+  private Class<? super T> superclass;
+
   /**
    * Not publicly instantiable.
    * 
@@ -119,9 +121,9 @@
   }
 
   public Class<? super T> getSuperclass() {
-    return (Class<? super T>) superclass;
+    return superclass;
   }
-  
+
   public boolean isArray() {
     return (modifiers & ARRAY) != 0;
   }
diff --git a/user/super/com/google/gwt/emul/java/lang/Enum.java b/user/super/com/google/gwt/emul/java/lang/Enum.java
index 98272ed..0a2a5b2 100644
--- a/user/super/com/google/gwt/emul/java/lang/Enum.java
+++ b/user/super/com/google/gwt/emul/java/lang/Enum.java
@@ -29,7 +29,7 @@
 
   protected static <T extends Enum<T>> T valueOf(JavaScriptObject map,
       String name) {
-    T result = Enum.<T>valueOf0(map, "_" + name);
+    T result = Enum.<T> valueOf0(map, "_" + name);
     if (result == null) {
       throw new IllegalArgumentException(name);
     }
@@ -41,11 +41,6 @@
     return map[name] || null;
   }-*/;
 
-  // public static <T extends Enum<T>> T valueOf(Class<T> enumType, String name)
-  // {
-  // throw new UnsupportedOperationException("not yet implemented.");
-  // }
-
   private final String name;
 
   private final int ordinal;
@@ -68,10 +63,11 @@
     return this == other;
   }
 
+  @SuppressWarnings("unchecked")
   public final Class<E> getDeclaringClass() {
     Class clazz = getClass();
     Class superclass = clazz.getSuperclass();
-    
+
     return (superclass == Enum.class) ? clazz : superclass;
   }
 
diff --git a/user/test/com/google/gwt/dev/jjs/test/EnumsTest.java b/user/test/com/google/gwt/dev/jjs/test/EnumsTest.java
index e971fa7..1a67d32 100644
--- a/user/test/com/google/gwt/dev/jjs/test/EnumsTest.java
+++ b/user/test/com/google/gwt/dev/jjs/test/EnumsTest.java
@@ -92,7 +92,7 @@
     assertEquals(Complex.class, Complex.A.getDeclaringClass());
     assertEquals(Subclassing.class, Subclassing.A.getDeclaringClass());
   }
-  
+
   public void testMethod() {
     assertEquals("X", Complex.A.value());
     assertEquals("Y", Complex.B.value());