From a6ced7a625540c5ac78568281d56afc4deb65d39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 5 Feb 2018 21:39:35 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20hand=20in=20a=20SoneProvider=20t?= =?utf8?q?o=20a=20class=20that=20is=20going=20to=20be=20the=20SoneProvider?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../pterodactylus/sone/database/memory/MemoryDatabase.java | 13 +++---------- .../sone/database/memory/MemoryDatabaseTest.java | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java index 5e5021c..07bcf2f 100644 --- a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java +++ b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java @@ -55,7 +55,6 @@ import net.pterodactylus.sone.database.PostBuilder; import net.pterodactylus.sone.database.PostDatabase; import net.pterodactylus.sone.database.PostReplyBuilder; import net.pterodactylus.sone.database.SoneBuilder; -import net.pterodactylus.sone.database.SoneProvider; import net.pterodactylus.util.config.Configuration; import net.pterodactylus.util.config.ConfigurationException; @@ -80,9 +79,6 @@ public class MemoryDatabase extends AbstractService implements Database { /** The lock. */ private final ReadWriteLock lock = new ReentrantReadWriteLock(); - /** The Sone provider. */ - private final SoneProvider soneProvider; - /** The configuration. */ private final Configuration configuration; private final ConfigurationLoader configurationLoader; @@ -125,14 +121,11 @@ public class MemoryDatabase extends AbstractService implements Database { /** * Creates a new memory database. * - * @param soneProvider - * The Sone provider * @param configuration * The configuration for loading and saving elements */ @Inject - public MemoryDatabase(SoneProvider soneProvider, Configuration configuration) { - this.soneProvider = soneProvider; + public MemoryDatabase(Configuration configuration) { this.configuration = configuration; this.configurationLoader = new ConfigurationLoader(configuration); memoryBookmarkDatabase = @@ -371,7 +364,7 @@ public class MemoryDatabase extends AbstractService implements Database { /** {@inheritDocs} */ @Override public PostBuilder newPostBuilder() { - return new MemoryPostBuilder(this, soneProvider); + return new MemoryPostBuilder(this, this); } // @@ -444,7 +437,7 @@ public class MemoryDatabase extends AbstractService implements Database { /** {@inheritDocs} */ @Override public PostReplyBuilder newPostReplyBuilder() { - return new MemoryPostReplyBuilder(this, soneProvider); + return new MemoryPostReplyBuilder(this, this); } // diff --git a/src/test/java/net/pterodactylus/sone/database/memory/MemoryDatabaseTest.java b/src/test/java/net/pterodactylus/sone/database/memory/MemoryDatabaseTest.java index bb62eaf..4d88429 100644 --- a/src/test/java/net/pterodactylus/sone/database/memory/MemoryDatabaseTest.java +++ b/src/test/java/net/pterodactylus/sone/database/memory/MemoryDatabaseTest.java @@ -75,7 +75,7 @@ public class MemoryDatabaseTest { private static final String SONE_ID = "sone"; private static final String RECIPIENT_ID = "recipient"; private final Configuration configuration = mock(Configuration.class); - private final MemoryDatabase memoryDatabase = new MemoryDatabase(null, configuration); + private final MemoryDatabase memoryDatabase = new MemoryDatabase(configuration); private final Sone sone = mock(Sone.class); @Before -- 2.7.4