From 3bb7cc80136a57b17998cadcf2f4df668e4f186a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 20 Oct 2013 02:58:03 +0200 Subject: [PATCH] Use the given database instead of the core to load images. --- src/main/java/net/pterodactylus/sone/core/SoneDownloader.java | 2 +- src/main/java/net/pterodactylus/sone/core/SoneParser.java | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java index 27348e1..d92527c 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java @@ -207,7 +207,7 @@ public class SoneDownloader extends AbstractService { * if a parse error occurs, or the protocol is invalid */ public Sone parseSone(Sone originalSone, InputStream soneInputStream) throws SoneException { - return new SoneParser(core).parseSone(core.getDatabase(), originalSone, soneInputStream); + return new SoneParser().parseSone(core.getDatabase(), originalSone, soneInputStream); } // diff --git a/src/main/java/net/pterodactylus/sone/core/SoneParser.java b/src/main/java/net/pterodactylus/sone/core/SoneParser.java index 0ca508b..4ce596e 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneParser.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneParser.java @@ -61,11 +61,6 @@ public class SoneParser { private static final Logger logger = Logger.getLogger(SoneParser.class.getName()); private static final int MAX_PROTOCOL_VERSION = 0; - private final Core core; - - public SoneParser(Core core) { - this.core = core; - } /** * Parses a Sone from the given input stream and creates a new Sone from the @@ -309,7 +304,7 @@ public class SoneParser { /* process avatar. */ if (avatarId != null) { - profile.setAvatar(core.getImage(avatarId).orNull()); + profile.setAvatar(database.getImage(avatarId).orNull()); } /* okay, apparently everything was parsed correctly. Now import. */ -- 2.7.4