Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Removed all but two warnings (both, scala and Lift warnings)

* Changed version of lift-sbt plugin from 2.4-SNAPSHOT to 2.4
  • Loading branch information...
commit a2f700af9ee43ecd4dc094ec429a6138e5120f09 1 parent 37a4264
@fmpwizard fmpwizard authored
Showing with 70 additions and 95 deletions.
  1. +2 −2 combo/example/src/main/scala/bootstrap/liftweb/Boot.scala
  2. +2 −2 combo/example/src/main/scala/net/liftweb/example/comet/Chat.scala
  3. +6 −9 combo/example/src/main/scala/net/liftweb/example/comet/Clock.scala
  4. +5 −7 combo/example/src/main/scala/net/liftweb/example/comet/LongTime.scala
  5. +1 −1  combo/example/src/main/scala/net/liftweb/example/lib/StatelessJson.scala
  6. +5 −8 combo/example/src/main/scala/net/liftweb/example/snippet/AjaxForm.scala
  7. +4 −9 combo/example/src/main/scala/net/liftweb/example/snippet/Misc.scala
  8. +1 −2  combo/example/src/main/scala/net/liftweb/example/snippet/SimpleWizard.scala
  9. +8 −12 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/model/SensorActor.scala
  10. +2 −2 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/Basic.scala
  11. +4 −4 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/GraphTypes.scala
  12. +1 −1  nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/Interacting.scala
  13. +4 −4 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/SettingOption.scala
  14. +6 −11 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/Zooming.scala
  15. +2 −2 nuggets/hellofbc/src/main/scala/bootstrap/liftweb/Boot.scala
  16. +3 −3 nuggets/hellolift/src/main/scala/com/hellolift/comet/DynamicBlogView.scala
  17. +3 −5 nuggets/hellolift/src/main/scala/com/hellolift/controller/BlogCache.scala
  18. +2 −2 nuggets/skittr/src/main/scala/bootstrap/liftweb/Boot.scala
  19. +8 −8 nuggets/skittr/src/main/scala/com/skittr/actor/UserActor.scala
  20. +1 −1  project/plugins/Plugins.scala
View
4 combo/example/src/main/scala/bootstrap/liftweb/Boot.scala
@@ -17,7 +17,7 @@ package bootstrap.liftweb
import net.liftweb._
import common.{Box, Full, Empty, Failure, Loggable}
-import util.{Helpers, Log, NamedPF, Props}
+import util.{Helpers, NamedPF, Props}
import http._
import actor._
import provider._
@@ -64,7 +64,7 @@ class Boot {
XmlServer.init()
- LiftRules.statelessDispatchTable.append {
+ LiftRules.statelessDispatch.append {
case r@Req("stateless" :: _, "", GetRequest) => StatelessHtml.render(r) _
}
View
4 combo/example/src/main/scala/net/liftweb/example/comet/Chat.scala
@@ -44,7 +44,7 @@ class Chat extends CometActor with CometListener {
private val liId = S.attr("li_id")
private lazy val li = liId.
- flatMap{ Helpers.findId(defaultXml, _) } openOr NodeSeq.Empty
+ flatMap{ Helpers.findId(defaultHtml, _) } openOr NodeSeq.Empty
private val inputId = Helpers.nextFuncName
@@ -53,7 +53,7 @@ class Chat extends CometActor with CometListener {
// to the browser
override def lowPriority = {
case ChatServerUpdate(value) => {
- val update = (value -- chats).reverse.
+ val update = (value filterNot (chats contains)).reverse.
map(b => AppendHtml(ulId, line(b)))
partialUpdate(update)
View
15 combo/example/src/main/scala/net/liftweb/example/comet/Clock.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2012 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package net.liftweb {
-package example {
-package comet {
+package net.liftweb
+package example
+package comet
import _root_.net.liftweb._
import http._
@@ -33,19 +33,16 @@ class ExampleClock (initSession: LiftSession,
initDefaultXml: NodeSeq,
initAttributes: Map[String, String]) extends CometActor {
// schedule a ping every 10 seconds so we redraw
- ActorPing.schedule(this, Tick, 10 seconds)
+ Schedule.schedule(this, Tick, 10 seconds)
def render = "#clock_time *" replaceWith timeNow.toString
override def lowPriority = {
case Tick =>
partialUpdate(SetHtml("clock_time", Text(timeNow.toString)))
- ActorPing.schedule(this, Tick, 10 seconds)
+ Schedule.schedule(this, Tick, 10 seconds)
}
initCometActor(initSession, initType, initName, initDefaultXml, initAttributes)
}
case object Tick
-}
-}
-}
View
12 combo/example/src/main/scala/net/liftweb/example/comet/LongTime.scala
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package net.liftweb {
-package example {
-package comet {
+package net.liftweb
+package example
+package comet
import net.liftweb.actor._
import scala.xml.{NodeSeq, Text}
@@ -51,7 +51,7 @@ object ThingBuilder extends LiftActor {
case (a: LiftActor, i: Int) =>
a ! BuildStatus(i * 10, Empty)
- ActorPing.schedule(this, (a, i + 1), 2 seconds)
+ Schedule.schedule(this, (a, i + 1), 2 seconds)
case _ =>
}
@@ -95,7 +95,5 @@ class LongTime extends CometActor {
<span>We're working on your job... it's {progress}% complete</span>
}
}
-}
-}
-}
+
View
2  combo/example/src/main/scala/net/liftweb/example/lib/StatelessJson.scala
@@ -34,7 +34,7 @@ import scala.xml._
object StatelessJson {
def init() {
// register the JSON handler
- LiftRules.statelessDispatchTable.append {
+ LiftRules.statelessDispatch.append{
case r @ Req("stateless_json_call" :: Nil, _, PostRequest) => () => handleJson(r)
}
}
View
13 combo/example/src/main/scala/net/liftweb/example/snippet/AjaxForm.scala
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package net.liftweb {
-package example {
-package snippet {
+package net.liftweb
+package example
+package snippet
import _root_.scala.xml._
import _root_.net.liftweb._
@@ -50,7 +50,7 @@ class AjaxForm {
// bind the view to the dynamic HTML
def show(xhtml: Group): NodeSeq = {
- val (name, js) = ajaxCall(JE.JsRaw("this.value"),
+ val (name: String, js): (String, JsExp) = ajaxCall(JE.JsRaw("this.value"),
s => After(200, replace(s)))
bind("select", xhtml,
"state" -> select(AjaxForm.states.map(s => (s,s)),
@@ -324,12 +324,9 @@ object AjaxForm {
"Wisconsin" -> "Madison",
"Wisconsin" -> "Milwaukee")
- val states = citiesAndStates.map(_._1).removeDuplicates
+ val states = citiesAndStates.map(_._1).distinct
val state: String = states.head
def citiesFor(state: String): List[String] = citiesAndStates.filter(_._1 == state).map(_._2)
}
-}
-}
-}
View
13 combo/example/src/main/scala/net/liftweb/example/snippet/Misc.scala
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package net.liftweb {
-package example {
-package snippet {
+package net.liftweb
+package example
+package snippet
import model._
@@ -141,14 +141,9 @@ class Misc {
}
private def locales =
- Locale.getAvailableLocales.toList.sort(_.getDisplayName < _.getDisplayName)
+ Locale.getAvailableLocales.toList.sortWith(_.getDisplayName < _.getDisplayName)
private def setLocale(loc: Locale) = definedLocale(Full(loc))
}
object definedLocale extends SessionVar[Box[Locale]](Empty)
-
-
-}
-}
-}
View
3  combo/example/src/main/scala/net/liftweb/example/snippet/SimpleWizard.scala
@@ -47,8 +47,7 @@ class SimpleWizard extends StatefulSnippet {
var color = ""
private def template(name: String, f: NodeSeq => NodeSeq): NodeSeq =
- TemplateFinder.
- findAnyTemplate(List("templating") ::: List(name)).map(f) openOr
+ Templates(List("templating") ::: List(name)).map(f) openOr
NodeSeq.Empty
/**
View
20 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/model/SensorActor.scala
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package net.liftweb {
-package flot_demo {
-package web {
-package model {
+package net.liftweb
+package flot_demo
+package web
+package model
import scala.collection.mutable.{HashMap, HashSet}
@@ -111,7 +111,7 @@ class AcumSamplesActor (max : Int) extends LiftActor {
case RemoveListener(listener: LiftActor) =>
- listeners = listeners.remove(listener.eq)
+ listeners = listeners.filterNot(listener.eq)
}
}
@@ -127,10 +127,10 @@ object Sensor extends _root_.java.lang.Runnable {
override def run () : Unit = {
while (true)
{
- val time = new _root_.java.util.Date ().getTime ()
+ val time = new java.util.Date ().getTime ()
- val sinus = Math.sin (time)
- val cosinus = Math.cos (time)
+ val sinus = math.sin (time)
+ val cosinus = math.cos (time)
val both = sinus + 2.0 * cosinus
acum ! Sample (time, List (sinus, cosinus, both))
@@ -139,7 +139,3 @@ object Sensor extends _root_.java.lang.Runnable {
}
}
}
-}
-}
-}
-}
View
4 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/Basic.scala
@@ -38,11 +38,11 @@ class Basic {
var d1 : List [Pair [Double, Double]] = Nil
for (i <- List.range (0, 140, 5))
- d1 = Pair (i / 10.0, Math.sin(i / 10.0)) :: d1
+ d1 = Pair (i / 10.0, math.sin(i / 10.0)) :: d1
val d2 : List [Pair [Double, Double]] = (0.0, 3.0) :: (4.0, 8.0) :: (8.0, 5.0) :: (9.0, 13.0) :: Nil
- var d3 : List [Pair [Double, Double]] = (0.0, 12.0) :: (7.0, 12.0) :: (Math.NaN_DOUBLE, Math.NaN_DOUBLE) ::
+ var d3 : List [Pair [Double, Double]] = (0.0, 12.0) :: (7.0, 12.0) :: (Double.NaN, Double.NaN) ::
(7.0, 2.5) :: (12.0, 2.5) :: Nil
val s1 = new FlotSerie () {
View
8 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/GraphTypes.scala
@@ -40,21 +40,21 @@ class GraphTypes {
var d1 : List [Pair [Double, Double]] = Nil
for (i <- List.range (0, 140, 5))
- d1 = Pair (i / 10.0, Math.sin(i / 10.0)) :: d1
+ d1 = Pair (i / 10.0, math.sin(i / 10.0)) :: d1
val d2 : List [Pair [Double, Double]] = (0.0, 3.0) :: (4.0, 8.0) :: (8.0, 5.0) :: (9.0, 13.0) :: Nil
var d3 : List [Pair [Double, Double]] = Nil
for (i <- List.range (0, 140, 5))
- d3 = (i / 10.0, Math.cos(i / 10.0)) :: d3
+ d3 = (i / 10.0, math.cos(i / 10.0)) :: d3
var d4 : List [Pair [Double, Double]] = Nil
for (i <- List.range (0, 140, 5))
- d4 = (i / 10.0, Math.sqrt(i * 1.0)) :: d4
+ d4 = (i / 10.0, math.sqrt(i * 1.0)) :: d4
var d5 : List [Pair [Double, Double]] = Nil
for (i <- List.range (0, 140, 5))
- d5 = (i / 10.0, Math.sqrt(i / 10.0)) :: d5
+ d5 = (i / 10.0, math.sqrt(i / 10.0)) :: d5
val s1 = new FlotSerie () {
override val data = d1
View
2  nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/Interacting.scala
@@ -40,7 +40,7 @@ class Interacting {
var d : List [Pair [Double, Double]] = Nil
for (i <- List.range (0, 140, 5))
- d = (i / 10.0, Math.sin(i / 10.0)) :: d
+ d = (i / 10.0, math.sin(i / 10.0)) :: d
val s = new FlotSerie () {
override val data = d
View
8 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/SettingOption.scala
@@ -43,11 +43,11 @@ class SettingOption {
var d3 : List [Pair [Double, Double]] = Nil
var i = 0.0
- while (i < Math.Pi * 2.0)
+ while (i < math.Pi * 2.0)
{
- d1 = (i, Math.sin(i)) :: d1
- d2 = (i, Math.cos(i)) :: d2
- d3 = (i, Math.tan(i)) :: d3
+ d1 = (i, math.sin(i)) :: d1
+ d2 = (i, math.cos(i)) :: d2
+ d3 = (i, math.tan(i)) :: d3
i += 0.25
}
View
17 nuggets/flotDemo/src/main/scala/net/liftweb/flot_demo/web/snippet/Zooming.scala
@@ -14,13 +14,12 @@
* limitations under the License.
*/
-package net.liftweb {
-package flot_demo {
-package web {
-package snippet {
+package net.liftweb
+package flot_demo
+package web
+package snippet
import scala.xml.NodeSeq
-
import net.liftweb.common._
import net.liftweb.util._
import Helpers._
@@ -39,7 +38,7 @@ class Zooming {
var i = x1
while (i < x2) {
- ret = (i, Math.sin (i * Math.sin(i))) :: ret
+ ret = (i, math.sin (i * math.sin(i))) :: ret
i += (x2 - x1) / 100
}
@@ -54,7 +53,7 @@ class Zooming {
def graph () = {
val data = new FlotSerie () {
override val label = Full ("sin(x sin(x))")
- override val data = getData (0.0, 3 * Math.Pi)
+ override val data = getData (0.0, 3 * math.Pi)
}
val options = new FlotOptions () {
@@ -107,7 +106,3 @@ class Zooming {
bind ("flot", xhtml, "graph" -> graph)
}
}
-}
-}
-}
-}
View
4 nuggets/hellofbc/src/main/scala/bootstrap/liftweb/Boot.scala
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package bootstrap.liftweb {
+package bootstrap.liftweb
import _root_.net.liftweb.util._
import _root_.net.liftweb.http._
@@ -72,6 +72,7 @@ class Boot {
c <- FacebookConnect.client
user <- User.findByFbId(c.session.uid)
} User.logUserIn(user)
+ case Failure(_,_,_) | Empty =>
}
//this is really important for fb connect
@@ -95,4 +96,3 @@ object DBVendor extends StandardDBVendor("org.h2.Driver",
Empty)
-}
View
6 nuggets/hellolift/src/main/scala/com/hellolift/comet/DynamicBlogView.scala
@@ -50,8 +50,8 @@ class DynamicBlogView extends CometActor {
// localSetup is the first thing run, we use it to setup the blogid or
// redirect them to / if no blogid was given.
override def localSetup {
- name match {
- case Full(t) => this.blogid = Helpers.toLong(t)
+ name map{
+ t => this.blogid = Helpers.toLong(t)
}
// Let the BlogCache know that we are watching for updates for this blog.
@@ -62,7 +62,7 @@ class DynamicBlogView extends CometActor {
// lowPriority will receive messages sent from the BlogCache
override def lowPriority : PartialFunction[Any, Unit] = {
- case BlogUpdate(entries : List[Entry]) => this.blog = entries; reRender(false)
+ case BlogUpdate(entries : List[_]) => this.blog = entries; reRender(false)
}
}
}
View
8 nuggets/hellolift/src/main/scala/com/hellolift/controller/BlogCache.scala
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-package com.hellolift {
-package controller {
+package com.hellolift
+package controller
import _root_.net.liftweb.mapper._
import _root_.net.liftweb.actor._
@@ -50,7 +50,7 @@ class BlogCache extends LiftActor {
case DeleteEntry(e, id) =>
// When an Entry is deleted
- cache += (id -> cache.getOrElse(id, getEntries(id)).remove(_ == e))
+ cache += (id -> cache.getOrElse(id, getEntries(id)).filterNot(_ == e))
sessions.getOrElse(id, Nil).foreach(_ ! BlogUpdate(cache.getOrElse(id, Nil)))
case EditEntry(e, id) =>
@@ -72,5 +72,3 @@ case class BlogUpdate(xs : List[Entry])
object BlogCache {
lazy val cache = new BlogCache // {val ret = new BlogCache; ret.start; ret}
}
-}
-}
View
4 nuggets/skittr/src/main/scala/bootstrap/liftweb/Boot.scala
@@ -16,7 +16,7 @@ package bootstrap.liftweb
* and limitations under the License.
*/
-import _root_.net.liftweb.util.{Helpers, Log, NamedPF}
+import _root_.net.liftweb.util.{Helpers, NamedPF}
import _root_.net.liftweb.common.{Box, Empty, Full, Failure}
import _root_.net.liftweb.http._
import _root_.net.liftweb.mapper._
@@ -52,7 +52,7 @@ class Boot {
RewriteResponse("unfriend" :: Nil, Map("user" -> user))
}
- LiftRules.rewrite.prepend(rewriter)
+ LiftRules.statelessRewrite.prepend(rewriter)
// load up the list of user actors
UserList.create
View
16 nuggets/skittr/src/main/scala/com/skittr/actor/UserActor.scala
@@ -107,7 +107,7 @@ class UserActor extends LiftActor with Loggable {
// get friends
friends = User.findAllByInsecureSql("SELECT users.* FROM users, friends WHERE users.id = friends.friend AND friends.owner = "+userId,
IHaveValidatedThisSQL("dpp",
- "08/23/08")).map(_.name.is).sort(_ < _)
+ "08/23/08")).map(_.name.is).sortWith(_ < _)
reply("Done")
// tell all our friends that we follow them
@@ -121,7 +121,7 @@ class UserActor extends LiftActor with Loggable {
// if we add a friend,
case AddFriend(name) =>
- friends = (name :: friends).sort(_ < _)
+ friends = (name :: friends).sortWith(_ < _)
// find the user
UserList.find(name).foreach{
ua =>
@@ -134,7 +134,7 @@ class UserActor extends LiftActor with Loggable {
// We are removing a friend
case RemoveFriend(name) =>
- friends = friends.remove(_ == name)
+ friends = friends.filterNot(_ == name)
// find the user
UserList.find(name).foreach{
ua =>
@@ -161,7 +161,7 @@ class UserActor extends LiftActor with Loggable {
// remove the timeline viewer
case RemoveTimelineViewer(who) =>
- timelineViewers = timelineViewers.remove(_ == who)
+ timelineViewers = timelineViewers.filterNot(_ == who)
// this.unlink(sender.receiver)
// Add an Actor to the list of folks who want to see when we get a message
@@ -172,7 +172,7 @@ class UserActor extends LiftActor with Loggable {
// removes the message viewer
case RemoveMessageViewer(who) =>
- messageViewers = messageViewers.remove(_ == who)
+ messageViewers = messageViewers.filterNot(_ == who)
// this.unlink(sender.receiver)
// add someone who is following us
@@ -181,7 +181,7 @@ class UserActor extends LiftActor with Loggable {
who ! MergeIntoTimeline(latestMsgs) // give the follower our messages to merge into his timeline
// remove the follower
- case RemoveFollower(who) => followers = followers.remove(_ == who) // filter out the sender of the message
+ case RemoveFollower(who) => followers = followers.filterNot(_ == who) // filter out the sender of the message
// We get a message
case msg : Message =>
@@ -203,12 +203,12 @@ class UserActor extends LiftActor with Loggable {
/**
* Sort the list in reverse chronological order and take the first maxMessages elements
*/
- private def merge(bigList: List[Message]) = bigList.sort((a,b) => b.when < a.when).take(maxMessages)
+ private def merge(bigList: List[Message]) = bigList.sortWith((a,b) => b.when < a.when).take(maxMessages)
/**
* Autogenerate and schedule a message
*/
- def autoGen = ActorPing.schedule(this, SendMessage("This is a random message @ "+timeNow+" for "+userName, "autogen"), User.randomPeriod)
+ def autoGen = Schedule.schedule(this, SendMessage("This is a random message @ "+timeNow+" for "+userName, "autogen"), User.randomPeriod)
}
/**
View
2  project/plugins/Plugins.scala
@@ -5,5 +5,5 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
lazy val snapshots = ScalaToolsSnapshots
// Add plugin
- lazy val a = "net.liftweb" % "lift-sbt" % "2.4-SNAPSHOT"
+ lazy val a = "net.liftweb" % "lift-sbt" % "2.4"
}
Please sign in to comment.
Something went wrong with that request. Please try again.