[Cherbot-commit] SF.net SVN: cherbot: [89] trunk/src/net/sf/cherbot/IRCConnection.java
Status: Alpha
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2007-06-20 20:31:34
|
Revision: 89
http://svn.sourceforge.net/cherbot/?rev=89&view=rev
Author: christianhujer
Date: 2007-06-20 13:31:32 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
Fixed bug: in and out were initialized with connect() but not with setSocket().
Modified Paths:
--------------
trunk/src/net/sf/cherbot/IRCConnection.java
Modified: trunk/src/net/sf/cherbot/IRCConnection.java
===================================================================
--- trunk/src/net/sf/cherbot/IRCConnection.java 2007-06-20 20:30:02 UTC (rev 88)
+++ trunk/src/net/sf/cherbot/IRCConnection.java 2007-06-20 20:31:32 UTC (rev 89)
@@ -73,9 +73,8 @@
/** {@inheritDoc} */
@Override @NotNull public Socket connect() throws IOException {
final Socket socket = super.connect();
- final PrintWriter out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), "utf-8"));
- this.out = out;
- this.in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "utf-8"));
+ final PrintWriter out = this.out;
+ assert this.out != null;
out.println("USER " + username + " 0 * :" + realname);
out.println("NICK " + nickname);
if (nickPassword != null) {
@@ -97,6 +96,13 @@
}
/** {@inheritDoc} */
+ @Override public void setSocket(@NotNull final Socket socket) throws IOException {
+ super.setSocket(socket);
+ out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), "utf-8"));
+ in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "utf-8"));
+ }
+
+ /** {@inheritDoc} */
public int run(@NotNull final List<String> args) throws Exception {
connect();
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|