From 99e44f21fef0b75791b7b08387bdcdfc8f6dfb65 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 12 May 2009 12:28:55 +0000 Subject: Reverted probably unintentional change to Enume... Reverted probably unintentional change to Enumeration (the method formerly called valueOf and now called withName needs to return Option[Value], not Value) and updated the failing tests to use the new Enumeration interface. --- src/library/scala/Enumeration.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/library') diff --git a/src/library/scala/Enumeration.scala b/src/library/scala/Enumeration.scala index e752fcd523..3dfd9bb740 100644 --- a/src/library/scala/Enumeration.scala +++ b/src/library/scala/Enumeration.scala @@ -113,12 +113,12 @@ abstract class Enumeration(initial: Int, names: String*) { * the argument s. * You must pass a String* set of names to the constructor, * or initialize each Enumeration with Value(String), - * for valueOf to work. + * for withName to work. * @param s an enumeration name * @return Some(Value) if an enumeration's name matches s, * else None */ - def withName(s: String): Value = values.find(_.toString == s).get + def withName(s: String): Option[Value] = values.find(_.toString == s) /** Creates a fresh value, part of this enumeration. */ protected final def Value: Value = Value(nextId) -- cgit v1.2.3