From b2d6a2b045f1c41927880fdb79f466ae3c918aaf Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 12 Oct 2014 20:02:42 +0200 Subject: [PATCH] Use closer from freenet. --- src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java index 3ae1371..ff0eaf7 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java @@ -17,6 +17,7 @@ package net.pterodactylus.sone.core; +import static freenet.support.io.Closer.close; import static java.lang.String.format; import static java.lang.System.currentTimeMillis; import static java.util.concurrent.TimeUnit.DAYS; @@ -31,7 +32,6 @@ import java.util.logging.Logger; import net.pterodactylus.sone.core.FreenetInterface.Fetched; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.data.Sone.SoneStatus; -import net.pterodactylus.util.io.Closer; import net.pterodactylus.util.service.AbstractService; import freenet.client.FetchResult; @@ -41,6 +41,7 @@ import freenet.keys.FreenetURI; import freenet.keys.USK; import freenet.node.RequestStarter; import freenet.support.api.Bucket; +import freenet.support.io.Closer; import com.db4o.ObjectContainer; import com.google.common.annotations.VisibleForTesting; @@ -237,8 +238,8 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade } catch (Exception e1) { logger.log(Level.WARNING, String.format("Could not parse Sone from %s!", requestUri), e1); } finally { - Closer.close(soneInputStream); - soneBucket.free(); + close(soneInputStream); + close(soneBucket); } return null; } -- 2.7.4