Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace scrooge-runtime with scrooge-serializer and fix errors. #141

Merged
merged 1 commit into from
Aug 31, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use sbt's %% operator?
"com.twitter" % "scrooge-serializer" %% "3.6.0"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, bug. Fixing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#145

Jeff Smick mailto:[email protected]
September 13, 2013 2:26 PM

In project/Build.scala:

@@ -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"

why not use sbt's %% operator?
"com.twitter" % "scrooge-serializer" %% "3.6.0"


Reply to this email directly or view it on GitHub
https://github.com/twitter/bijection/pull/141/files#r6359420.

Argyris Zymnis mailto:[email protected]

August 30, 2013 4:41 PM

    You can merge this Pull Request by running

git pull https://github.com/azymnis/bijection argyris/fix_scrooge_breaks

Or view, comment on, or merge it at:

#141

    Commit Summary

Sam Ritchie, Twitter Inc
703.662.1337
@sritchie

)
).dependsOn(bijectionCore % "test->test;compile->compile")

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


}