Skip to content

Commit

Permalink
Improve coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
ngocdaothanh committed Apr 24, 2014
1 parent 13cd84f commit fe29110
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/xitrum/handler/AccessLog.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object AccessLog extends Log {
val dt = endTimestamp - beginTimestamp
val env = action.handlerEnv
if (Config.xitrum.metrics.isDefined && Config.xitrum.metrics.get.actions) {
val histograms = xitrum.Metrics.registry.getHistograms()
val histograms = xitrum.Metrics.registry.getHistograms
val histogram =
if (histograms.containsKey(action.getClass.getName))
histograms.get(action.getClass.getName)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/xitrum/util/Secure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ object Secure {
if (data.length <= 4) return None

val b = ByteBuffer.wrap(data)
val l = b.getInt()
val l = b.getInt
if (l <= 0 || l >= data.length - 4) return None

val d = new Array[Byte](l)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/xitrum/view/Renderer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ trait Renderer extends GetActionClassDefaultsToCurrentAction {
def renderInlineView(inlineView: Any): String = {
renderedView = inlineView
val any = layout // Call layout
any.toString()
any.toString
}
}
9 changes: 4 additions & 5 deletions src/test/scala/xitrum/etag/EtagTest.scala
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package xitrum.etag

import org.scalatest.Matchers
import org.scalatest.FlatSpec
import java.io.File
import java.io.FileOutputStream

class EtagTest extends FlatSpec with Matchers {
import org.scalatest.Matchers
import org.scalatest.FlatSpec

class EtagTest extends FlatSpec with Matchers {
behavior of "ETag"

it should "stay same while file is not modified" in {
val file = File.createTempFile("etag", "test")
val filePath = file.getAbsoluteFile().toString()
val filePath = file.getAbsoluteFile.toString
file.deleteOnExit()

val result = Etag.forFile(filePath, None, false)
Expand All @@ -31,5 +31,4 @@ class EtagTest extends FlatSpec with Matchers {

etag should not equal (Etag.forFile(filePath, None, false).asInstanceOf[Etag.Small].etag)
}

}
4 changes: 2 additions & 2 deletions src/test/scala/xitrum/local/LruCacheTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package xitrum.local

import org.scalatest.Matchers
import org.scalatest.FlatSpec
import xitrum.Config

import org.slf4j.LoggerFactory
import com.typesafe.config.ConfigFactory
import xitrum.Config

class LruCacheTest extends FlatSpec with Matchers {
behavior of "LruCache"
Expand Down

0 comments on commit fe29110

Please sign in to comment.