Skip to content
Browse files

Fix #1026: Make MappedString.apply(null) not require a type annotation

  • Loading branch information...
1 parent 7b651f0 commit 03c95bc8f5880a49ebfcba887135a0c56c86b19f @nafg nafg committed
Showing with 7 additions and 4 deletions.
  1. +7 −4 persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala
View
11 persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala
@@ -51,7 +51,12 @@ trait ValidateLength extends MixableMappedField {
}
-abstract class MappedString[T<:Mapper[T]](val fieldOwner: T,val maxLen: Int) extends MappedField[String, T] with net.liftweb.util.StringValidators {
+trait HasApplyBoxString[T] {
+ @deprecated("Just use apply(x openOr null). Will be removed in 2.5.")
+ def apply(ov: Box[String])(implicit disambiguateFromApplyBoxedForeign: BoxedStringToken): T = apply(ov openOr null)
+ def apply(x: String): T
+}
+abstract class MappedString[T<:Mapper[T]](val fieldOwner: T,val maxLen: Int) extends MappedField[String, T] with net.liftweb.util.StringValidators with HasApplyBoxString[T] {
private val data: FatLazy[String] = FatLazy(defaultValue) // defaultValue
private val orgData: FatLazy[String] = FatLazy(defaultValue) // defaultValue
@@ -129,9 +134,7 @@ abstract class MappedString[T<:Mapper[T]](val fieldOwner: T,val maxLen: Int) ext
}
}
-
- @deprecated("Just use apply(x openOr null). Will be removed in 2.5.")
- def apply(ov: Box[String])(implicit disambiguateFromApplyBoxedForeign: BoxedStringToken): T = apply(ov openOr null)
+ override def apply(v: String): T = super.apply(v)
def asJsExp: JsExp = JE.Str(is)

0 comments on commit 03c95bc

Please sign in to comment.
Something went wrong with that request. Please try again.