From: David ‘Bombe’ Roden Date: Sun, 10 Apr 2011 11:01:03 +0000 (+0200) Subject: Instantiate album via caching mechanism. X-Git-Tag: beta-freefall-0.6.2-1~59 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=3851ef08bb57cf59850b167580896ec23ff26e29;p=Sone.git Instantiate album via caching mechanism. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 6a90c7a..3a0a722 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1320,7 +1320,6 @@ public class Core implements IdentityListener, UpdateListener { } /* load albums. */ - Map albums = new HashMap(); List topLevelAlbums = new ArrayList(); while (true) { String albumPrefix = sonePrefix + "/Albums/" + albums.size(); @@ -1335,10 +1334,9 @@ public class Core implements IdentityListener, UpdateListener { logger.log(Level.WARNING, "Invalid album found, aborting load!"); return; } - Album album = new Album(albumId).setSone(sone).setName(albumName).setDescription(albumDescription); - albums.put(albumId, album); + Album album = getAlbum(albumId).setSone(sone).setName(albumName).setDescription(albumDescription); if (albumParentId != null) { - Album parentAlbum = albums.get(albumParentId); + Album parentAlbum = getAlbum(albumParentId, false); if (parentAlbum == null) { logger.log(Level.WARNING, "Invalid parent album ID: " + albumParentId); return;