Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:boundary/scalang

* 'master' of github.com:boundary/scalang:
  Close the streams
  • Loading branch information...
commit 939f48f796d384e9348a3af529ae7d04f806a795 2 parents 0d5fe04 + ead0dff
@d2fn d2fn authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/main/scala/scalang/Node.scala
View
13 src/main/scala/scalang/Node.scala
@@ -88,15 +88,18 @@ object Node {
protected def readFile(file : File) : String = {
val in = new BufferedReader(new FileReader(file))
- val cookie = in.readLine
- in.close
- cookie
+ try
+ in.readLine
+ finally
+ in.close
}
protected def writeCookie(file : File, cookie : String) {
val out = new FileWriter(file)
- out.write(cookie)
- out.close
+ try
+ out.write(cookie)
+ finally
+ out.close
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.