src/share/classes/java/lang/Enum.java

Print this page
rev 815 : 6327048: Enum javadoc could link to JLS
6653154: Exception message for bad Enum.valueOf has spurious "class"
Reviewed-by: emcmanus

@@ -1,7 +1,7 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Sun designates this

@@ -32,10 +32,15 @@
 import java.io.ObjectStreamException;
 
 /**
  * This is the common base class of all Java language enumeration types.
  *
+ * More information about enums, including implicit methods synthesised
+ * by the compiler, can be found in <i>The Java&trade; Language
+ * Specification, Third Edition</i>, <a
+ * href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.9">&sect;8.9</a>.
+ *
  * @author  Josh Bloch
  * @author  Neal Gafter
  * @see     Class#getEnumConstants()
  * @since   1.5
  */

@@ -210,11 +215,11 @@
         if (result != null)
             return result;
         if (name == null)
             throw new NullPointerException("Name is null");
         throw new IllegalArgumentException(
-            "No enum const " + enumType +"." + name);
+            "No enum constant " + enumType.getCanonicalName() + "." + name);
     }
 
     /**
      * enum classes cannot have finalize methods.
      */