Permalink
Browse files

mechanical fixes

  • Loading branch information...
1 parent 7be5f5f commit f714619b5a67d793ef9ce7e3f27ffe06850ad9af @imikushin imikushin committed May 10, 2012
Showing with 114 additions and 161 deletions.
  1. +11 −6 pom.xml
  2. +1 −1 src/main/java/com/codahale/jerkson/JsonSnakeCase.java
  3. +2 −2 src/main/scala/com/codahale/jerkson/Factory.scala
  4. +1 −1 src/main/scala/com/codahale/jerkson/Generator.scala
  5. +2 −2 src/main/scala/com/codahale/jerkson/Json.scala
  6. +3 −2 src/main/scala/com/codahale/jerkson/Parser.scala
  7. +2 −2 src/main/scala/com/codahale/jerkson/ParsingException.scala
  8. +3 −3 src/main/scala/com/codahale/jerkson/ScalaModule.scala
  9. +1 −1 src/main/scala/com/codahale/jerkson/StreamingIterator.scala
  10. +2 −2 src/main/scala/com/codahale/jerkson/Types.scala
  11. +2 −4 src/main/scala/com/codahale/jerkson/deser/BigDecimalDeserializer.scala
  12. +2 −4 src/main/scala/com/codahale/jerkson/deser/BigIntDeserializer.scala
  13. +2 −4 src/main/scala/com/codahale/jerkson/deser/BitSetDeserializer.scala
  14. +5 −7 src/main/scala/com/codahale/jerkson/deser/CaseClassDeserializer.scala
  15. +4 −6 src/main/scala/com/codahale/jerkson/deser/EitherDeserializer.scala
  16. +3 −5 src/main/scala/com/codahale/jerkson/deser/ImmutableMapDeserializer.scala
  17. +3 −5 src/main/scala/com/codahale/jerkson/deser/IntMapDeserializer.scala
  18. +3 −5 src/main/scala/com/codahale/jerkson/deser/IteratorDeserializer.scala
  19. +3 −5 src/main/scala/com/codahale/jerkson/deser/JValueDeserializer.scala
  20. +3 −5 src/main/scala/com/codahale/jerkson/deser/LongMapDeserializer.scala
  21. +3 −5 src/main/scala/com/codahale/jerkson/deser/MutableLinkedHashMapDeserializer.scala
  22. +3 −5 src/main/scala/com/codahale/jerkson/deser/MutableListDeserializer.scala
  23. +3 −5 src/main/scala/com/codahale/jerkson/deser/MutableMapDeserializer.scala
  24. +3 −5 src/main/scala/com/codahale/jerkson/deser/OptionDeserializer.scala
  25. +3 −5 src/main/scala/com/codahale/jerkson/deser/QueueDeserializer.scala
  26. +5 −6 src/main/scala/com/codahale/jerkson/deser/RangeDeserializer.scala
  27. +2 −2 src/main/scala/com/codahale/jerkson/deser/ScalaDeserializers.scala
  28. +3 −5 src/main/scala/com/codahale/jerkson/deser/SeqDeserializer.scala
  29. +2 −4 src/main/scala/com/codahale/jerkson/deser/StringBuilderDeserializer.scala
  30. +3 −5 src/main/scala/com/codahale/jerkson/ser/CaseClassSerializer.scala
  31. +2 −4 src/main/scala/com/codahale/jerkson/ser/EitherSerializer.scala
  32. +2 −4 src/main/scala/com/codahale/jerkson/ser/IterableSerializer.scala
  33. +2 −4 src/main/scala/com/codahale/jerkson/ser/IteratorSerializer.scala
  34. +2 −4 src/main/scala/com/codahale/jerkson/ser/JValueSerializer.scala
  35. +2 −4 src/main/scala/com/codahale/jerkson/ser/MapSerializer.scala
  36. +2 −4 src/main/scala/com/codahale/jerkson/ser/OptionSerializer.scala
  37. +2 −4 src/main/scala/com/codahale/jerkson/ser/RangeSerializer.scala
  38. +3 −3 src/main/scala/com/codahale/jerkson/ser/ScalaSerializers.scala
  39. +2 −4 src/main/scala/com/codahale/jerkson/ser/StringBuilderSerializer.scala
  40. +2 −2 src/main/scala/com/codahale/jerkson/util/CaseClassSigParser.scala
  41. +2 −2 src/test/scala/com/codahale/jerkson/tests/BasicTypeSupportSpec.scala
  42. +1 −1 src/test/scala/com/codahale/jerkson/tests/CaseClassSupportSpec.scala
  43. +2 −2 src/test/scala/com/codahale/jerkson/tests/ExampleCaseClasses.scala
View
17 pom.xml
@@ -6,12 +6,12 @@
<groupId>com.codahale</groupId>
<artifactId>jerkson_2.9.1</artifactId>
- <version>0.5.1-SNAPSHOT</version>
+ <version>0.6-SNAPSHOT</version>
<name>Jerkson for Scala ${scala.version}</name>
<properties>
<scala.version>2.9.1</scala.version>
- <jackson.version>[1.9.0,2.0.0)</jackson.version>
+ <jackson.version>[2.0.0,3.0.0)</jackson.version>
</properties>
<developers>
@@ -66,13 +66,18 @@
<version>${scala.version}</version>
</dependency>
<dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
@@ -1,6 +1,6 @@
package com.codahale.jerkson;
-import org.codehaus.jackson.annotate.JacksonAnnotation;
+import com.fasterxml.jackson.annotation.JacksonAnnotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -1,7 +1,7 @@
package com.codahale.jerkson
-import org.codehaus.jackson.JsonFactory
-import org.codehaus.jackson.map.ObjectMapper
+import com.fasterxml.jackson.core.JsonFactory
+import com.fasterxml.jackson.databind.ObjectMapper
trait Factory {
/**
@@ -1,7 +1,7 @@
package com.codahale.jerkson
import java.io.{File, OutputStream, Writer, StringWriter}
-import org.codehaus.jackson.{JsonGenerator, JsonEncoding}
+import com.fasterxml.jackson.core.{JsonGenerator, JsonEncoding}
trait Generator extends Factory {
/**
@@ -1,7 +1,7 @@
package com.codahale.jerkson
-import org.codehaus.jackson.map.{MappingJsonFactory, ObjectMapper}
-import org.codehaus.jackson.{JsonGenerator, JsonParser => JacksonParser}
+import com.fasterxml.jackson.databind.{MappingJsonFactory, ObjectMapper}
+import com.fasterxml.jackson.core.{JsonGenerator, JsonParser => JacksonParser}
object Json extends Json
@@ -3,8 +3,9 @@ package com.codahale.jerkson
import io.Source
import java.net.URL
import com.codahale.jerkson.AST.{JValue, JNull}
-import org.codehaus.jackson.{JsonNode, JsonParser, JsonProcessingException}
-import org.codehaus.jackson.node.TreeTraversingParser
+import com.fasterxml.jackson.core.{JsonParser, JsonProcessingException}
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.node.TreeTraversingParser
import java.io.{EOFException, Reader, File, InputStream}
trait Parser extends Factory {
@@ -1,8 +1,8 @@
package com.codahale.jerkson
import java.io.IOException
-import org.codehaus.jackson.map.JsonMappingException
-import org.codehaus.jackson.{JsonParseException, JsonProcessingException}
+import com.fasterxml.jackson.databind.JsonMappingException
+import com.fasterxml.jackson.core.{JsonParseException, JsonProcessingException}
object ParsingException {
def apply(cause: JsonProcessingException): ParsingException = {
@@ -1,9 +1,9 @@
package com.codahale.jerkson
import deser.ScalaDeserializers
-import org.codehaus.jackson.map.Module.SetupContext
-import org.codehaus.jackson.Version
-import org.codehaus.jackson.map.Module
+import com.fasterxml.jackson.databind.Module.SetupContext
+import com.fasterxml.jackson.core.Version
+import com.fasterxml.jackson.databind.Module
import ser.ScalaSerializers
class ScalaModule(classLoader: ClassLoader) extends Module {
@@ -1,6 +1,6 @@
package com.codahale.jerkson
-import org.codehaus.jackson.{JsonToken, JsonParser}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
class StreamingIterator[A](parser: JsonParser, mf: Manifest[A])
extends Iterator[A] {
@@ -1,7 +1,7 @@
package com.codahale.jerkson
-import org.codehaus.jackson.`type`.JavaType
-import org.codehaus.jackson.map.`type`.{TypeFactory, ArrayType}
+import com.fasterxml.jackson.databind.JavaType
+import com.fasterxml.jackson.databind.`type`.{TypeFactory, ArrayType}
import scala.collection.JavaConversions.asScalaConcurrentMap
import java.util.concurrent.ConcurrentHashMap
@@ -1,10 +1,8 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.JsonParser
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.JsonParser
-@JsonCachable
class BigDecimalDeserializer extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext) = {
if (jp.getCurrentToken == null) {
@@ -1,10 +1,8 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.JsonParser
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.JsonParser
-@JsonCachable
class BigIntDeserializer extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext) = {
if (jp.getCurrentToken == null) {
@@ -2,11 +2,9 @@ package com.codahale.jerkson.deser
import scala.collection.generic.BitSetFactory
import scala.collection.{BitSetLike, BitSet}
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.{JsonToken, JsonParser}
-import org.codehaus.jackson.map.annotate.JsonCachable
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
-@JsonCachable
class BitSetDeserializer[Coll <: BitSet with BitSetLike[Coll]](factory: BitSetFactory[Coll])
extends JsonDeserializer[Coll] {
@@ -5,13 +5,11 @@ import scala.collection.mutable.ArrayBuffer
import com.codahale.jerkson.JsonSnakeCase
import com.codahale.jerkson.util._
import com.codahale.jerkson.Util._
-import org.codehaus.jackson.{JsonNode, JsonToken, JsonParser}
-import org.codehaus.jackson.map._
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.node.{ObjectNode, NullNode, TreeTraversingParser}
-import org.codehaus.jackson.`type`.JavaType
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
+import com.fasterxml.jackson.databind._
+import com.fasterxml.jackson.databind.node.{ObjectNode, NullNode, TreeTraversingParser}
+import com.fasterxml.jackson.databind.JavaType
-@JsonCachable
class CaseClassDeserializer(config: DeserializationConfig,
javaType: JavaType,
provider: DeserializerProvider,
@@ -77,7 +75,7 @@ class CaseClassDeserializer(config: DeserializationConfig,
private def errorMessage(node: JsonNode) = {
val names = params.map { _._1 }.mkString("[", ", ", "]")
val existing = node match {
- case obj: ObjectNode => obj.getFieldNames.mkString("[", ", ", "]")
+ case obj: ObjectNode => obj.fieldNames.mkString("[", ", ", "]")
case _: NullNode => "[]" // this is what Jackson deserializes the inside of an empty object to
case unknown => "a non-object"
}
@@ -1,12 +1,10 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.JsonParser
-import org.codehaus.jackson.`type`.JavaType
-import org.codehaus.jackson.map.{DeserializerProvider, DeserializationConfig, DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.node.TreeTraversingParser
+import com.fasterxml.jackson.core.JsonParser
+import com.fasterxml.jackson.databind.JavaType
+import com.fasterxml.jackson.databind.{DeserializationConfig, DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.databind.node.TreeTraversingParser
-@JsonCachable
class EitherDeserializer(config: DeserializationConfig,
javaType: JavaType,
provider: DeserializerProvider) extends JsonDeserializer[Object] {
@@ -1,13 +1,11 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.`type`.JavaType
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.{JsonToken, JsonParser}
-import org.codehaus.jackson.map.annotate.JsonCachable
+import com.fasterxml.jackson.databind.JavaType
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
import collection.generic.MapFactory
import collection.MapLike
-@JsonCachable
class ImmutableMapDeserializer[CC[A, B] <: Map[A, B] with MapLike[A, B, CC[A, B]]](companion: MapFactory[CC],
valueType: JavaType,
valueDeserializer: JsonDeserializer[Object])
@@ -1,12 +1,10 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.{JsonToken, JsonParser}
-import org.codehaus.jackson.`type`.JavaType
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
+import com.fasterxml.jackson.databind.JavaType
import scala.collection.immutable.IntMap
-@JsonCachable
class IntMapDeserializer(valueType: JavaType,
valueDeserializer: JsonDeserializer[Object]) extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext) = {
@@ -1,11 +1,9 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.`type`.JavaType
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.{JsonToken, JsonParser}
-import org.codehaus.jackson.map.annotate.JsonCachable
+import com.fasterxml.jackson.databind.JavaType
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
-@JsonCachable
class IteratorDeserializer(elementType: JavaType,
elementDeserializer: JsonDeserializer[Object]) extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext) = {
@@ -1,14 +1,12 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.{JsonToken, JsonParser}
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
import com.codahale.jerkson.AST._
import collection.mutable.ArrayBuffer
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.map.`type`.TypeFactory
+import com.fasterxml.jackson.databind.`type`.TypeFactory
import com.codahale.jerkson.Types
-@JsonCachable
class JValueDeserializer(factory: TypeFactory, klass: Class[_]) extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext): Object = {
if (jp.getCurrentToken == null) {
@@ -1,12 +1,10 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.{JsonToken, JsonParser}
-import org.codehaus.jackson.`type`.JavaType
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
+import com.fasterxml.jackson.databind.JavaType
import scala.collection.immutable.LongMap
-@JsonCachable
class LongMapDeserializer(valueType: JavaType,
valueDeserializer: JsonDeserializer[Object]) extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext) = {
@@ -1,12 +1,10 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.`type`.JavaType
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.databind.JavaType
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
import scala.collection.mutable
-import org.codehaus.jackson.{JsonToken, JsonParser}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
-@JsonCachable
class MutableLinkedHashMapDeserializer(valueType: JavaType,
valueDeserializer: JsonDeserializer[Object]) extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext) = {
@@ -1,17 +1,15 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.`type`.JavaType
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.databind.JavaType
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
import scala.collection.mutable.MutableList
-import org.codehaus.jackson.{JsonToken, JsonParser}
-import org.codehaus.jackson.map.annotate.JsonCachable
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
// TODO: 6/2/11 <coda> -- replace MutableListDeserializer with a SeqDeserializer when we drop 2.8.1
/**
* We only need this because MutableList has no generic companion in 2.8.1.
*/
-@JsonCachable
class MutableListDeserializer(elementType: JavaType,
elementDeserializer: JsonDeserializer[Object]) extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext) = {
@@ -1,12 +1,10 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.`type`.JavaType
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.{JsonToken, JsonParser}
+import com.fasterxml.jackson.databind.JavaType
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
import scala.collection.mutable
-@JsonCachable
class MutableMapDeserializer(valueType: JavaType,
valueDeserializer: JsonDeserializer[Object]) extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext) = {
@@ -1,11 +1,9 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.`type`.JavaType
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.{JsonToken, JsonParser}
-import org.codehaus.jackson.map.annotate.JsonCachable
+import com.fasterxml.jackson.databind.JavaType
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
-@JsonCachable
class OptionDeserializer(elementType: JavaType,
elementDeserializer: JsonDeserializer[Object])
extends JsonDeserializer[Object] {
@@ -1,17 +1,15 @@
package com.codahale.jerkson.deser
-import org.codehaus.jackson.map.annotate.JsonCachable
-import org.codehaus.jackson.`type`.JavaType
-import org.codehaus.jackson.map.{DeserializationContext, JsonDeserializer}
-import org.codehaus.jackson.{JsonToken, JsonParser}
+import com.fasterxml.jackson.databind.JavaType
+import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer}
+import com.fasterxml.jackson.core.{JsonToken, JsonParser}
import scala.collection.mutable.Queue
// TODO: 6/2/11 <coda> -- replace QueueDeserializer with a SeqDeserializer when we drop 2.8.1
/**
* We only need this because Queue has no generic companion in 2.8.1.
*/
-@JsonCachable
class QueueDeserializer(elementType: JavaType,
elementDeserializer: JsonDeserializer[Object]) extends JsonDeserializer[Object] {
def deserialize(jp: JsonParser, ctxt: DeserializationContext) = {
Oops, something went wrong.

0 comments on commit f714619

Please sign in to comment.