Skip to content

Commit

Permalink
Merge branch 'release/0.9.6' into 2.12_release
Browse files Browse the repository at this point in the history
  • Loading branch information
Piyush Narang committed Sep 13, 2017
2 parents e03143e + 22e57ed commit 0d6b0d6
Show file tree
Hide file tree
Showing 20 changed files with 86 additions and 101 deletions.
5 changes: 4 additions & 1 deletion COMMITTERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ Please see our [Project Governance](https://github.com/twitter/analytics-infra-g
|------------------------|-----------------------------------------------------------|
| Alex Levenson | [@isnotinvain](https://github.com/isnotinvain) |
| Ben Pence | [@benpence](https://github.com/benpence) |
| Erik Osheim | [@non](https://github.com/non) |
| Ian O'Connell | [@ianoc](https://github.com/ianoc) |
| Joe Nievelt | [@jnievelt](https://github.com/jnievelt) |
| Oscar Boykin | [@johnynek](https://github.com/johnynek) |
| Pankaj Gupta | [@pankajroark](https://github.com/pankajroark) |
| Piyush Narang | [@piyushnarang](https://github.com/piyushnarang) |
| Ruban Monu | [@rubanm](https://github.com/rubanm) |
| Sam Ritchie | [@sritchie](https://github.com/sritchie) |
| Sriram Krishnan | [@sriramkrishnan](https://github.com/sriramkrishnan) |
| Travis Brown | [@travisbrown](https://github.com/travisbrown) |

##Emeritus
## Emeritus
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ package com.twitter.bijection

import java.io.Serializable
import java.nio.{ByteBuffer, BufferOverflowException}
import java.nio.channels.Channel
import scala.annotation.implicitNotFound
import scala.annotation.tailrec
import scala.collection.mutable.{Builder, Map => MMap, Set => MSet, Buffer => MBuffer}
import scala.collection.mutable.{Map => MMap, Set => MSet, Buffer => MBuffer}
import scala.collection.generic.CanBuildFrom
import scala.util.{Failure, Success, Try}
import com.twitter.bijection.Inversion.attempt
Expand Down Expand Up @@ -129,12 +128,13 @@ object Bufferable extends GeneratedTupleBufferable with Serializable {
}

// This automatically doubles the ByteBuffer if we get a buffer-overflow
@tailrec
def reallocatingPut(bb: ByteBuffer)(putfn: (ByteBuffer) => ByteBuffer): ByteBuffer = {
val init = bb.duplicate
try {
putfn(init)
} catch {
case ex: BufferOverflowException => reallocatingPut(reallocate(bb))(putfn)
case _: BufferOverflowException => reallocatingPut(reallocate(bb))(putfn)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ import java.util.{
Map => JMap,
Set => JSet
}
import java.util.concurrent.{ConcurrentMap => JConcurrentMap}
import scala.collection.JavaConverters._
import scala.collection.mutable
import collection.generic.CanBuildFrom
import scala.reflect.ClassTag

trait CollectionBijections extends BinaryBijections {
import Conversion.asMethod

/**
* Bijections between collection types defined in scala.collection.JavaConverters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@ limitations under the License.

package com.twitter.bijection

import java.lang.{Iterable => JIterable}
import java.util.{
Collection => JCollection,
Dictionary => JDictionary,
Enumeration => JEnumeration,
Iterator => JIterator,
List => JList,
Map => JMap,
Set => JSet
}
import java.util.concurrent.{ConcurrentMap => JConcurrentMap}
import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.collection.generic.CanBuildFrom
import scala.util.{Success, Try}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/
package com.twitter.bijection

import scala.util.{Failure, Success, Try}
import scala.util.{Failure, Try}
import scala.util.control.NonFatal

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ package com.twitter.bijection

import java.io._
import scala.util.{Failure, Try}
import scala.util.control.Exception.allCatch
import com.twitter.bijection.Inversion.attempt
import scala.reflect.ClassTag

object JavaSerializationInjection extends Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ import java.lang.{
}

import java.math.BigInteger
import java.nio.ByteBuffer
import java.util.UUID

import Bijection.{build, fromInjection}

trait NumericBijections extends GeneratedTupleBijections {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ import java.lang.{
Byte => JByte
}
import java.nio.ByteBuffer
import java.util.UUID
import scala.util.Success
import Bijection.build
import Inversion.{attempt, attemptWhen}

trait NumericInjections extends GeneratedTupleInjections {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ limitations under the License.

package com.twitter.bijection

import java.net.URL
import java.util.UUID

import scala.annotation.tailrec
import scala.collection.generic.CanBuildFrom

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import java.net.{URLDecoder, URLEncoder, URL}
import java.nio.charset.{Charset, CharsetDecoder, CoderResult, CodingErrorAction}
import java.nio.{ByteBuffer, CharBuffer}
import java.util.UUID
import scala.annotation.tailrec
import scala.collection.generic.CanBuildFrom
import scala.util.Try

trait StringInjections extends NumericInjections {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ import java.io.{
ObjectInputStream,
Serializable
}
import java.util.Arrays
import org.scalacheck.Arbitrary
import org.scalacheck.Prop.forAll
import org.scalatest.prop.PropertyChecks
import org.scalatest.{PropSpec, MustMatchers}
import scala.math.Equiv
import scala.reflect.ClassTag
import scala.util.Success
Expand Down Expand Up @@ -141,3 +138,5 @@ trait BaseProperties {
def arbitraryViaInjection[A, B](implicit inj: Injection[A, B], arb: Arbitrary[A]): Arbitrary[B] =
Arbitrary { arb.arbitrary.map { inj(_) } }
}

object BaseProperties extends BaseProperties
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ class CollectionLaws extends CheckProperties with BaseProperties {
isBijection[Vector[Int], IndexedSeq[Int]]
}

property("Seq[Long] <=> IndexedSeq[Long]") {
isBijection[Seq[Long], IndexedSeq[Long]]
}

property("Seq[Long] <=> List[Long]") {
isBijection[Seq[Long], List[Long]]
}

property("IndexedSeq[Long] <=> IndexedSeq[(Int, Int)]") {
isBijection[IndexedSeq[Long], IndexedSeq[(Int, Int)]]
}

property("List[Int] <=> IndexedSeq[String @@ Rep[Int]]") {
isBijection[List[Int], IndexedSeq[String @@ Rep[Int]]]
}
Expand All @@ -102,4 +114,16 @@ class CollectionLaws extends CheckProperties with BaseProperties {
property("round trip Set[Int] -> List[String]") {
isInjection[Set[Int], List[String]]
}

property("round trip Set[Int] -> Vector[String]") {
isInjection[Set[Int], Vector[String]]
}

property("round trip List[Int] -> List[String]") {
isInjection[List[Int], List[String]]
}

property("round trip Set[Int] -> Set[String]") {
isInjection[Set[Int], Set[String]]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ limitations under the License.
package com.twitter.bijection

import org.scalacheck.{Prop, Gen}
import org.scalacheck.Prop.forAll
import org.scalatest.{PropSpec, MustMatchers}
import org.scalatest.prop.PropertyChecks
import org.scalatest.MustMatchers

import Conversion.asMethod // get the .as syntax

Expand Down
Loading

0 comments on commit 0d6b0d6

Please sign in to comment.