From 5b7e77d92a7dc57652332c87031c6d638d7588eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 18 Apr 2020 16:33:44 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=9A=9A=20Rename=20method=20to=20better=20r?= =?utf8?q?eflect=20purpose?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt | 2 +- .../kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt | 2 +- .../kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoaderTest.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt index 474ab57..c039aaa 100644 --- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt +++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt @@ -31,7 +31,7 @@ class IdentityLoader @Inject constructor(private val webOfTrustConnector: WebOfT private val logger: Logger = Logger.getLogger(IdentityLoader::class.java.name) @Throws(WebOfTrustException::class) - fun loadIdentities() = + fun loadTrustedIdentities() = time({ stopwatch, identities -> "Loaded ${identities.size} own identities in ${stopwatch.elapsed(MILLISECONDS) / 1000.0}s." }) { webOfTrustConnector.loadAllOwnIdentities() }.let(this::loadTrustedIdentitiesForOwnIdentities) diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt index 676278d..36d31fb 100644 --- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt +++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt @@ -56,7 +56,7 @@ class IdentityManagerImpl @Inject constructor( while (!shouldStop()) { try { - val currentIdentities = identityLoader.loadIdentities() + val currentIdentities = identityLoader.loadTrustedIdentities() val identitiesWithTrust = currentIdentities.values.flatten() .groupBy { it.id } diff --git a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoaderTest.kt b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoaderTest.kt index b3a8447..8827d77 100644 --- a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoaderTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoaderTest.kt @@ -42,7 +42,7 @@ class IdentityLoaderTest { @Test fun loadingIdentities() { val identityLoader = IdentityLoader(webOfTrustConnector, Context("Test")) - val identities = identityLoader.loadIdentities() + val identities = identityLoader.loadTrustedIdentities() assertThat(identities.keys, hasSize(4)) assertThat(identities.keys, containsInAnyOrder(ownIdentities[0], ownIdentities[1], ownIdentities[2], ownIdentities[3])) verifyIdentitiesForOwnIdentity(identities, ownIdentities[0], createTrustedIdentitiesForFirstOwnIdentity()) @@ -54,7 +54,7 @@ class IdentityLoaderTest { @Test fun loadingIdentitiesWithoutContext() { val identityLoaderWithoutContext = IdentityLoader(webOfTrustConnector) - val identities = identityLoaderWithoutContext.loadIdentities() + val identities = identityLoaderWithoutContext.loadTrustedIdentities() assertThat(identities.keys, hasSize(4)) assertThat(identities.keys, containsInAnyOrder(ownIdentities[0], ownIdentities[1], ownIdentities[2], ownIdentities[3])) verifyIdentitiesForOwnIdentity(identities, ownIdentities[0], createTrustedIdentitiesForFirstOwnIdentity()) -- 2.7.4