< prev index next >
src/java.base/share/classes/sun/net/smtp/SmtpClient.java
Print this page
rev 14210 : 8154231: Simplify access to System properties from JDK code
Reviewed-by: rriggs
*** 23,36 ****
* questions.
*/
package sun.net.smtp;
- import java.util.StringTokenizer;
import java.io.*;
import java.net.*;
import sun.net.TransferProtocolClient;
/**
* This class implements the SMTP client.
* You can send a piece of mail by creating a new SmtpClient, calling
* the "to" method to add destinations, calling "from" to name the
--- 23,36 ----
* questions.
*/
package sun.net.smtp;
import java.io.*;
import java.net.*;
import sun.net.TransferProtocolClient;
+ import sun.security.action.GetPropertyAction;
/**
* This class implements the SMTP client.
* You can send a piece of mail by creating a new SmtpClient, calling
* the "to" method to add destinations, calling "from" to name the
*** 155,166 ****
} catch(Exception e) {
}
}
try {
String s;
! mailhost = java.security.AccessController.doPrivileged(
! new sun.security.action.GetPropertyAction("mail.host"));
if (mailhost != null) {
openServer(mailhost);
return;
}
} catch(Exception e) {
--- 155,165 ----
} catch(Exception e) {
}
}
try {
String s;
! mailhost = GetPropertyAction.getProperty("mail.host");
if (mailhost != null) {
openServer(mailhost);
return;
}
} catch(Exception e) {
*** 182,193 ****
public SmtpClient(int to) throws IOException {
super();
setConnectTimeout(to);
try {
String s;
! mailhost = java.security.AccessController.doPrivileged(
! new sun.security.action.GetPropertyAction("mail.host"));
if (mailhost != null) {
openServer(mailhost);
return;
}
} catch(Exception e) {
--- 181,191 ----
public SmtpClient(int to) throws IOException {
super();
setConnectTimeout(to);
try {
String s;
! mailhost = GetPropertyAction.getProperty("mail.host");
if (mailhost != null) {
openServer(mailhost);
return;
}
} catch(Exception e) {
< prev index next >