diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2008-03-12 16:26:32 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2008-03-12 16:26:32 +0000 |
commit | 44c4ab87bddbb9e1f093ab2e28868de8f31ebf75 (patch) | |
tree | 3fe0bbe02db99c517859e9650b93c87f7ad8d69e | |
parent | a0eb2af8114da819faa26d7ea2880790398d5ada (diff) | |
download | scala-44c4ab87bddbb9e1f093ab2e28868de8f31ebf75.tar.gz scala-44c4ab87bddbb9e1f093ab2e28868de8f31ebf75.tar.bz2 scala-44c4ab87bddbb9e1f093ab2e28868de8f31ebf75.zip |
Fixed unreachable code in JSON parser.
-rw-r--r-- | sabbus.xml | 3 | ||||
-rw-r--r-- | src/library/scala/util/parsing/json/JSON.scala | 29 |
2 files changed, 15 insertions, 17 deletions
diff --git a/sabbus.xml b/sabbus.xml index b4f6f764e8..5d0039f696 100644 --- a/sabbus.xml +++ b/sabbus.xml @@ -585,6 +585,9 @@ BOOTRAPING TEST AND TEST SUITE <target name="stability.test" depends="strap.load"> <same dir="${build-quick.dir}" todir="${build-strap.dir}" failondifferent="no"> <exclude name="**/*.properties"/> + <exclude name="bin/**"/> + <exclude name="lib/**"/> + <exclude name="pack.complete"/> </same> </target> diff --git a/src/library/scala/util/parsing/json/JSON.scala b/src/library/scala/util/parsing/json/JSON.scala index 734a8de008..71bf2fbcb3 100644 --- a/src/library/scala/util/parsing/json/JSON.scala +++ b/src/library/scala/util/parsing/json/JSON.scala @@ -43,22 +43,17 @@ object JSON extends Parser { * A utility method to resolve a parsed JSON list into objects or * arrays. See the parse method for details. */ - def resolveType(input: List[Any]): Any = - input match { - case jo: List[Any] => - var objMap = Map[String, Any]() - - if(jo.forall { - case (key: String, value : List[Any]) => - objMap = objMap + key -> resolveType(value) - true - case _ => false - }) objMap - else { - jo - } + def resolveType(input: List[Any]): Any = { + var objMap = Map[String, Any]() + + if(input.forall { + case (key: String, value : List[Any]) => + objMap = objMap + key -> resolveType(value) + true + case _ => false + }) objMap + else + input + } - case _ @ elem => - elem - } } |