summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2009-11-03 17:00:06 +0000
committerPhilipp Haller <hallerp@gmail.com>2009-11-03 17:00:06 +0000
commit13d642151f0ad834fad3e8868608d5af5b4372bc (patch)
tree0bc45ab5991d241ca30be61c09c70e56142b76e5 /src
parentd7f7a3e001fb825240554a02a7cff72bef96f409 (diff)
downloadscala-13d642151f0ad834fad3e8868608d5af5b4372bc.tar.gz
scala-13d642151f0ad834fad3e8868608d5af5b4372bc.tar.bz2
scala-13d642151f0ad834fad3e8868608d5af5b4372bc.zip
Fix and test for #2527
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/Enumeration.scala11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/library/scala/Enumeration.scala b/src/library/scala/Enumeration.scala
index 8d38f71f79..d5153bd50d 100644
--- a/src/library/scala/Enumeration.scala
+++ b/src/library/scala/Enumeration.scala
@@ -121,9 +121,14 @@ abstract class Enumeration(initial: Int, names: String*) {
* initialize each Enumeration with Value(String). Otherwise, the
* names are determined automatically through reflection.
*
- * @param s an enumeration name
- * @return <tt>Some(Value)</tt> if an enumeration's name matches <var>s</var>,
- * else <tt>None</tt>
+ * Note the change here wrt 2.7 is intentional. You should know whether
+ * a name is in an Enumeration beforehand. If not, just use find on
+ * values.
+ *
+ * @param s an Enumeration name
+ * @return the Value of this Enumeration if its name matches <var>s</var>
+ * @throws java.util.NoSuchElementException if no Value with a matching
+ * name is in this Enumeration
*/
final def withName(s: String): Value = values.find(_.toString == s).get