From: David ‘Bombe’ Roden Date: Sun, 13 Nov 2016 10:22:42 +0000 (+0100) Subject: Fix multiple constructors with @Inject annotation X-Git-Tag: 0.9.7^2~438 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e7dffc33d7632aeeb41eeeef53f0170b34dd0137;p=Sone.git Fix multiple constructors with @Inject annotation --- diff --git a/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt b/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt index 98a2caa..ac3ab6a 100644 --- a/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt +++ b/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt @@ -11,7 +11,9 @@ import javax.inject.Inject /** * [ElementLoader] implementation that uses a simple Guava [com.google.common.cache.Cache]. */ -class DefaultElementLoader @Inject constructor(private val freenetInterface: FreenetInterface, ticker: Ticker = Ticker.systemTicker()) : ElementLoader { +class DefaultElementLoader(private val freenetInterface: FreenetInterface, ticker: Ticker) : ElementLoader { + + @Inject constructor(freenetInterface: FreenetInterface) : this(freenetInterface, Ticker.systemTicker()) private val loadingLinks = CacheBuilder.newBuilder().build() private val failureCache = CacheBuilder.newBuilder().ticker(ticker).expireAfterWrite(30, MINUTES).build()