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

Update scala-library to 2.13.9 in 4.0 #1125

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/scala/org/json4s/FullTypeHints.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.json4s.reflect.Reflector
*/
case class FullTypeHints(hints: List[Class[_]], override val typeHintFieldName: String = "jsonClass")
extends TypeHints {
def hintFor(clazz: Class[_]) = Some(clazz.getName)
def hintFor(clazz: Class[_]): Some[String] = Some(clazz.getName)
def classFor(hint: String, parent: Class[_]) = {
Reflector
.scalaTypeOf(hint)
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/org/json4s/NoTypeHints.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package org.json4s
*/
case object NoTypeHints extends TypeHints {
val hints: List[Class[_]] = Nil
def hintFor(clazz: Class[_]) = None
def classFor(hint: String, parent: Class[_]) = None
def hintFor(clazz: Class[_]): None.type = None
def classFor(hint: String, parent: Class[_]): None.type = None
override def shouldExtractHints(clazz: Class[_]) = false
}
2 changes: 1 addition & 1 deletion core/src/main/scala/org/json4s/ShortTypeHints.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package org.json4s
*/
case class ShortTypeHints(hints: List[Class[_]], override val typeHintFieldName: String = "jsonClass")
extends TypeHints {
def hintFor(clazz: Class[_]) =
def hintFor(clazz: Class[_]): Some[String] =
Some(clazz.getName.substring(clazz.getName.lastIndexOf(".") + 1))
def classFor(hint: String, parent: Class[_]) = hints find (hintFor(_).exists(_ == hint))
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import com.fasterxml.jackson.databind.{BeanDescription, DeserializationConfig, J
private object JValueDeserializerResolver extends Deserializers.Base {
private[this] val J_VALUE = classOf[JValue]

override def findBeanDeserializer(javaType: JavaType, config: DeserializationConfig, beanDesc: BeanDescription) = {
override def findBeanDeserializer(
javaType: JavaType,
config: DeserializationConfig,
beanDesc: BeanDescription
): JValueDeserializer = {
if (!J_VALUE.isAssignableFrom(javaType.getRawClass)) null
else new JValueDeserializer(javaType.getRawClass)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import com.fasterxml.jackson.databind.{BeanDescription, JavaType, SerializationC

private object JValueSerializerResolver extends Serializers.Base {
private[this] val JVALUE = classOf[JValue]
override def findSerializer(config: SerializationConfig, theType: JavaType, beanDesc: BeanDescription) = {
override def findSerializer(
config: SerializationConfig,
theType: JavaType,
beanDesc: BeanDescription
): JValueSerializer = {
if (!JVALUE.isAssignableFrom(theType.getRawClass)) null
else new JValueSerializer
}
Expand Down
2 changes: 1 addition & 1 deletion project/build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ object build {

val Scala211 = "2.11.12"
val Scala212 = "2.12.17"
val Scala213 = "2.13.8"
val Scala213 = "2.13.9"
val Scala3 = "3.1.1"

def json4sSettings(cross: Boolean) = mavenCentralFrouFrou ++ Def.settings(
Expand Down
12 changes: 6 additions & 6 deletions scalap/src/main/scala/org/json4s/scalap/Result.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sealed abstract class Result[+Out, +A, +X] {
case class Success[+Out, +A](out: Out, value: A) extends Result[Out, A, Nothing] {
def error = throw new ScalaSigParserError("No error")

def toOption = Some(value)
def toOption: Some[A] = Some(value)

def map[B](f: A => B): Result[Out, B, Nothing] = Success(out, f(value))
def mapOut[Out2](f: Out => Out2): Result[Out2, A, Nothing] = Success(f(out), value)
Expand All @@ -53,12 +53,12 @@ sealed abstract class NoSuccess[+X] extends Result[Nothing, Nothing, X] {
def out = throw new ScalaSigParserError("No output")
def value = throw new ScalaSigParserError("No value")

def toOption = None
def toOption: None.type = None

def map[B](f: Nothing => B) = this
def mapOut[Out2](f: Nothing => Out2) = this
def map[Out2, B](f: (Nothing, Nothing) => (Out2, B)) = this
def flatMap[Out2, B](f: (Nothing, Nothing) => Result[Out2, B, Nothing]) = this
def map[B](f: Nothing => B): NoSuccess[X] = this
def mapOut[Out2](f: Nothing => Out2): NoSuccess[X] = this
def map[Out2, B](f: (Nothing, Nothing) => (Out2, B)): NoSuccess[X] = this
def flatMap[Out2, B](f: (Nothing, Nothing) => Result[Out2, B, Nothing]): NoSuccess[X] = this
def orElse[Out2, B](other: => Result[Out2, B, Nothing]) = other
}

Expand Down
2 changes: 1 addition & 1 deletion scalap/src/main/scala/org/json4s/scalap/Rules.scala
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,5 @@ trait StateRules {
}

trait RulesWithState extends Rules with StateRules {
val factory = this
val factory: RulesWithState = this
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ trait Symbol extends Flags {

case object NoSymbol extends Symbol {
def name = "<no symbol>"
def parent = None
def parent: None.type = None
def hasFlag(flag: Long) = false
def children = Nil
def children: Nil.type = Nil
}

abstract class ScalaSigSymbol extends Symbol {
Expand Down Expand Up @@ -59,7 +59,7 @@ abstract class SymbolInfoSymbol extends ScalaSigSymbol {

def entry = symbolInfo.entry
def name = symbolInfo.name
def parent = Some(symbolInfo.owner)
def parent: Some[Symbol] = Some(symbolInfo.owner)
def hasFlag(flag: Long) = (symbolInfo.flags & flag) != 0L

lazy val infoType = applyRule(parseEntry(typeEntry)(symbolInfo.info))
Expand Down