diff --git a/modules/core/src/main/scala/scalacache/serialization/binary/JavaSerializationAnyRefCodec.scala b/modules/core/src/main/scala/scalacache/serialization/binary/JavaSerializationAnyRefCodec.scala
index c129a691..14670915 100644
--- a/modules/core/src/main/scala/scalacache/serialization/binary/JavaSerializationAnyRefCodec.scala
+++ b/modules/core/src/main/scala/scalacache/serialization/binary/JavaSerializationAnyRefCodec.scala
@@ -31,10 +31,11 @@ class JavaSerializationAnyRefCodec[S <: Serializable](classTag: ClassTag[S]) ext
 
   def using[T <: Closeable, R](obj: T)(f: T => R): R =
     try f(obj)
-    finally try obj.close()
-    catch {
-      case NonFatal(_) => // does nothing
-    }
+    finally
+      try obj.close()
+      catch {
+        case NonFatal(_) => // does nothing
+      }
 
   def encode(value: S): Array[Byte] =
     using(new ByteArrayOutputStream()) { buf =>