Skip to content

Commit

Permalink
Merge pull request #110 from blemale/bastien.lemale/Small_clean_ups
Browse files Browse the repository at this point in the history
Small clean ups
  • Loading branch information
blemale committed Mar 21, 2020
2 parents dee0028 + db703fd commit 131c491
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions project/TravisCredentials.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sbt.Keys._
import sbt._
import sbt.{Def, _}

object TravisCredentials {

def updateCredentials() =
def updateCredentials(): Def.Setting[Task[Seq[Credentials]]] =
(for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CacheLoaderAdapter<K, V> implements CacheLoader<K, V>{
}

@Override
public V load(@Nonnull K key) throws Exception {
public V load(@Nonnull K key) {
return loader.apply(key);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/com/github/blemale/scaffeine/Scaffeine.scala
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ case class Scaffeine[K, V](underlying: caffeine.cache.Caffeine[K, V]) {
* @throws java.lang.IllegalArgumentException if `size` is negative
* @throws java.lang.IllegalStateException if a maximum size was already set
*/
def weigher[K1 <: K, V1 <: V](weigher: (K1, V1) => Int) =
def weigher[K1 <: K, V1 <: V](weigher: (K1, V1) => Int): Scaffeine[K1, V1] =
Scaffeine(underlying.weigher(new caffeine.cache.Weigher[K1, V1] {
override def weigh(key: K1, value: V1): Int = weigher(key, value)
}))
Expand Down Expand Up @@ -324,7 +324,7 @@ case class Scaffeine[K, V](underlying: caffeine.cache.Caffeine[K, V]) {
* @param scheduler the scheduler that submits a task to the [[Scaffeine.executor*]] after a given delay
* @return this builder instance
*/
def scheduler(scheduler: Scheduler) =
def scheduler(scheduler: Scheduler): Scaffeine[K, V] =
Scaffeine(underlying.scheduler(scheduler))

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class CacheSpec extends AnyWordSpec with Matchers with OptionValues {
cache.getIfPresent("foo")
cache.getIfPresent("bar")

val stats = cache.stats
val stats = cache.stats()

stats.requestCount should be(2)
stats.hitRate should be(0.5 +- 0.01)
Expand Down

0 comments on commit 131c491

Please sign in to comment.