moving error correction code to the setter.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11356 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-08-09 05:49:09 +00:00
1 parent 9afe121036
commit 36840d4bcf
1 file changed
+6 -6
+6 -6
View File
@@ -225,12 +225,7 @@ public class Mailer extends Publisher {
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
// this code is brain dead
smtpHost = nullify(req.getParameter("mailer_smtp_server"));
adminAddress = req.getParameter("mailer_admin_address");
if(adminAddress.startsWith("\"") && adminAddress.endsWith("\"")) {
// some users apparently quote the whole thing. Don't konw why
// anyone does this, but it's a machine's job to forgive human mistake
adminAddress = adminAddress.substring(1,adminAddress.length()-1);
}
setAdminAddress(req.getParameter("mailer_admin_address"));
defaultSuffix = nullify(req.getParameter("mailer_default_suffix"));
String url = nullify(json.getString("url"));
@@ -294,6 +289,11 @@ public class Mailer extends Publisher {
}
public void setAdminAddress(String adminAddress) {
if(adminAddress.startsWith("\"") && adminAddress.endsWith("\"")) {
// some users apparently quote the whole thing. Don't konw why
// anyone does this, but it's a machine's job to forgive human mistake
adminAddress = adminAddress.substring(1,adminAddress.length()-1);
}
this.adminAddress = adminAddress;
}