6651717: Debug output statement left in MailToURLConnection

Removed output statement, removed unused imports, added override tags.

Reviewed-by: chegar
This commit is contained in:
Jean-Christophe Collet 2008-03-05 18:11:33 +01:00
parent 45c655a782
commit e33dde9817

View File

@ -29,9 +29,6 @@ import java.net.URL;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.SocketPermission; import java.net.SocketPermission;
import java.io.*; import java.io.*;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.StringTokenizer;
import java.security.Permission; import java.security.Permission;
import sun.net.www.*; import sun.net.www.*;
import sun.net.smtp.SmtpClient; import sun.net.smtp.SmtpClient;
@ -86,11 +83,11 @@ public class MailToURLConnection extends URLConnection {
} }
public void connect() throws IOException { public void connect() throws IOException {
System.err.println("connect. Timeout = " + connectTimeout);
client = new SmtpClient(connectTimeout); client = new SmtpClient(connectTimeout);
client.setReadTimeout(readTimeout); client.setReadTimeout(readTimeout);
} }
@Override
public synchronized OutputStream getOutputStream() throws IOException { public synchronized OutputStream getOutputStream() throws IOException {
if (os != null) { if (os != null) {
return os; return os;
@ -107,6 +104,7 @@ public class MailToURLConnection extends URLConnection {
return os; return os;
} }
@Override
public Permission getPermission() throws IOException { public Permission getPermission() throws IOException {
if (permission == null) { if (permission == null) {
connect(); connect();
@ -116,22 +114,26 @@ public class MailToURLConnection extends URLConnection {
return permission; return permission;
} }
@Override
public void setConnectTimeout(int timeout) { public void setConnectTimeout(int timeout) {
if (timeout < 0) if (timeout < 0)
throw new IllegalArgumentException("timeouts can't be negative"); throw new IllegalArgumentException("timeouts can't be negative");
connectTimeout = timeout; connectTimeout = timeout;
} }
@Override
public int getConnectTimeout() { public int getConnectTimeout() {
return (connectTimeout < 0 ? 0 : connectTimeout); return (connectTimeout < 0 ? 0 : connectTimeout);
} }
@Override
public void setReadTimeout(int timeout) { public void setReadTimeout(int timeout) {
if (timeout < 0) if (timeout < 0)
throw new IllegalArgumentException("timeouts can't be negative"); throw new IllegalArgumentException("timeouts can't be negative");
readTimeout = timeout; readTimeout = timeout;
} }
@Override
public int getReadTimeout() { public int getReadTimeout() {
return readTimeout < 0 ? 0 : readTimeout; return readTimeout < 0 ? 0 : readTimeout;
} }