X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Futil%2Ffreenet%2Ffcp2%2FConnection.java;h=c4cb66909daaf895b818c5f3d514f11c1b5fa5b4;hb=953de352675a4ad91fe307d816a4ea7780c94274;hp=5ae344ce5a7145c161064e40b4520fab550c31e6;hpb=93895a33c778a8660c7f8ea09d2566a567c1890a;p=jSite.git diff --git a/src/de/todesbaum/util/freenet/fcp2/Connection.java b/src/de/todesbaum/util/freenet/fcp2/Connection.java index 5ae344c..c4cb669 100644 --- a/src/de/todesbaum/util/freenet/fcp2/Connection.java +++ b/src/de/todesbaum/util/freenet/fcp2/Connection.java @@ -1,6 +1,5 @@ /* - * todesbaum-lib - - * Copyright (C) 2006 David Roden + * jSite - Connection.java - Copyright © 2006–2012 David Roden * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -216,34 +215,15 @@ public class Connection { * Disconnects from the node. */ public void disconnect() { - if (nodeWriter != null) { - try { - nodeWriter.close(); - } catch (IOException ioe1) { - } - nodeWriter = null; - } - if (nodeOutputStream != null) { - try { - nodeOutputStream.close(); - } catch (IOException ioe1) { - } - nodeOutputStream = null; - } - if (nodeInputStream != null) { - try { - nodeInputStream.close(); - } catch (IOException ioe1) { - } - nodeInputStream = null; - } - if (nodeSocket != null) { - try { - nodeSocket.close(); - } catch (IOException ioe1) { - } - nodeSocket = null; - } + Closer.close(nodeWriter); + nodeWriter = null; + Closer.close(nodeOutputStream); + nodeOutputStream = null; + Closer.close(nodeInputStream); + nodeInputStream = null; + nodeInputStream = null; + Closer.close(nodeSocket); + nodeSocket = null; synchronized (this) { notify(); } @@ -324,6 +304,7 @@ public class Connection { * Main loop of the reader. Lines are read and converted into * {@link Message} objects. */ + @SuppressWarnings("synthetic-access") public void run() { LineInputStream nodeReader = null; try {