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

uPickle 2.0.0 #115

Draft
wants to merge 1 commit into
base: v1
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion bench/src/main/scala/bench/BlackholeUVisitor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BlackholeUVisitor(bh: Blackhole) extends Visitor[Any, Null] {
}
}

override def visitObject(length: Int, index: Int): ObjVisitor[Any, Null] = new ObjVisitor[Any, Null] {
override def visitObject(length: Int, jsonableKeys: Boolean, index: Int): ObjVisitor[Any, Null] = new ObjVisitor[Any, Null] {
override def visitKey(index: Int): Visitor[_, _] = {
BlackholeUVisitor.this
}
Expand Down
4 changes: 2 additions & 2 deletions bench/src/main/scala/bench/ScalaVersionBench.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class FlatPrimitivesDefaultBench extends PickleFromToBench(ScalaVersionDefaultBe

class FlatPrimitivesTruncDefaultBench extends PickleFromToBench(ScalaVersionDefaultBench.benchmarkFlatPrimitivesTrunc)

@OutputTimeUnit(TimeUnit.MILLISECONDS)
@OutputTimeUnit(TimeUnit.SECONDS)
class HandrolledFlatPrimitivesBench extends PickleFromToBench(HandrolledFlatPrimitives())

@Warmup(iterations = 3, time = 5, timeUnit = TimeUnit.SECONDS)
Expand Down Expand Up @@ -335,7 +335,7 @@ object HandrolledFlatPrimitives {
implicit val writer: default.Reader[HandrolledFlatPrimitives] = upickle.default.macroR[HandrolledFlatPrimitives]
implicit val reader: default.Writer[HandrolledFlatPrimitives] = new upickle.default.Writer[HandrolledFlatPrimitives] {
override def write0[V](out: core.Visitor[_, V], v: HandrolledFlatPrimitives): V = {
val obj = out.visitObject(6, -1).narrow
val obj = out.visitObject(6, true, -1).narrow

obj.visitKeyValue(obj.visitKey(-1).visitString("i", -1))
obj.visitValue(obj.subVisitor.visitInt32(Int.MinValue, -1), -1)
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ lazy val `weejson-upickle` = project
.dependsOn(weepickle)
.settings(
libraryDependencies ++= Seq(
"com.lihaoyi" %% "upickle" % "1.4.2",
"com.lihaoyi" %% "upickle" % "2.0.0",
),
mimaPreviousArtifacts := {
if (VersionNumber(version.value).matchesSemVer(SemanticSelector("<1.6.0")))
Expand Down
2 changes: 1 addition & 1 deletion project/WeePicklePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object WeePicklePlugin extends AutoPlugin {

val scala211 = "2.11.12"
val scala212 = "2.12.12"
val scala213 = "2.13.7"
val scala213 = "2.13.8"
val scala3 = "3.1.0"
val supportedScala2Versions = Seq(scala211, scala212, scala213)
val supportedScalaVersions = supportedScala2Versions :+ scala3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UWVisitor[T, J](visitor: upickle.core.Visitor[T, J]) extends Visitor[T, J]
}

override def visitObject(length: Int): ObjVisitor[T, J] = {
val obj = visitor.visitObject(length, -1)
val obj = visitor.visitObject(length, true, -1)
new ObjVisitor[T, J] {
override def visitKey(): Visitor[_, _] = new UWVisitor(obj.visitKey(-1))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class WUVisitor[T, J](weepickle: Visitor[T, J]) extends upickle.core.Visitor[T,
}
}

override def visitObject(length: Int, index: Int): ObjVisitor[T, J] = {
override def visitObject(length: Int, jsonableKeys: Boolean, index: Int): ObjVisitor[T, J] = {
val obj = weepickle.visitObject(length)

new ObjVisitor[T, J] {
Expand Down