Skip to content

Commit

Permalink
Replace scrooge-runtime with scrooge-serializer and fix errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Argyris Zymnis committed Aug 30, 2013
1 parent 41a57bd commit e86205c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,27 @@
*/
package com.twitter.bijection.scrooge

import com.twitter.scrooge.{ThriftException, ThriftStruct, ThriftStructCodec}
import com.twitter.scrooge.{ThriftException, ThriftStruct, ThriftStructCodec3}
import org.apache.thrift.protocol._
import java.nio.ByteBuffer
import com.twitter.finagle.SourcedException
import scala.collection.mutable
import scala.collection.{Map, Set}


object TestStruct extends ThriftStructCodec[TestStruct] {
object TestStruct extends ThriftStructCodec3[TestStruct] {
val Struct = new TStruct("TestStruct")
val SomeIntField = new TField("someInt", TType.I32, 1)
val SomeStringField = new TField("someString", TType.STRING, 2)

def encode(_item: TestStruct, _oproto: TProtocol) { _item.write(_oproto) }
def decode(_iprot: TProtocol) = Immutable.decode(_iprot)
/**
* Checks that all required fields are non-null.
*/
def validate(_item: TestStruct) {
}

def apply(_iprot: TProtocol): TestStruct = decode(_iprot)
override def encode(_item: TestStruct, _oproto: TProtocol) { _item.write(_oproto) }
override def decode(_iprot: TProtocol) = Immutable.decode(_iprot)

def apply(
someInt: Int,
Expand All @@ -30,9 +35,9 @@ object TestStruct extends ThriftStructCodec[TestStruct] {

def unapply(_item: TestStruct): Option[Product2[Int, Option[String]]] = Some(_item)

object Immutable extends ThriftStructCodec[TestStruct] {
def encode(_item: TestStruct, _oproto: TProtocol) { _item.write(_oproto) }
def decode(_iprot: TProtocol) = {
object Immutable extends ThriftStructCodec3[TestStruct] {
override def encode(_item: TestStruct, _oproto: TProtocol) { _item.write(_oproto) }
override def decode(_iprot: TProtocol) = {
var someInt: Int = 0
var _got_someInt = false
var someString: String = null
Expand Down Expand Up @@ -116,7 +121,7 @@ trait TestStruct extends ThriftStruct
def _2 = someString

override def write(_oprot: TProtocol) {
validate()
TestStruct.validate(this)
_oprot.writeStructBegin(Struct)
if (true) {
val someInt_item = someInt
Expand All @@ -142,12 +147,6 @@ trait TestStruct extends ThriftStruct
someString
)

/**
* Checks that all required fields are non-null.
*/
def validate() {
}

override def canEqual(other: Any): Boolean = other.isInstanceOf[TestStruct]

override def equals(other: Any): Boolean = runtime.ScalaRunTime._equals(this, other)
Expand Down
4 changes: 2 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ object BijectionBuild extends Build {
osgiExportAll("com.twitter.bijection.scrooge"),
libraryDependencies ++= Seq(
"org.apache.thrift" % "libthrift" % "0.6.1" exclude("junit", "junit"),
"com.twitter" % "scrooge-runtime" % "3.0.4"
"com.twitter" % "scrooge-serializer_2.9.2" % "3.6.0"
)
).dependsOn(bijectionCore % "test->test;compile->compile")

Expand Down Expand Up @@ -231,5 +231,5 @@ object BijectionBuild extends Build {
)
).dependsOn(bijectionCore % "test->test;compile->compile")


}

0 comments on commit e86205c

Please sign in to comment.