ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email Mailer.java
Date Fri, 08 Nov 2002 15:42:25 GMT
bodewig     2002/11/08 07:42:25

  Modified:    src/main/org/apache/tools/ant/taskdefs/email Tag:
                        ANT_15_BRANCH Mailer.java
  Log:
  Merge fix for PR14046 from HEAD
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.3   +2 -29     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/Mailer.java
  
  Index: Mailer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/Mailer.java,v
  retrieving revision 1.4.2.2
  retrieving revision 1.4.2.3
  diff -u -r1.4.2.2 -r1.4.2.3
  --- Mailer.java	19 Jun 2002 07:22:13 -0000	1.4.2.2
  +++ Mailer.java	8 Nov 2002 15:42:24 -0000	1.4.2.3
  @@ -53,14 +53,10 @@
    */
   package org.apache.tools.ant.taskdefs.email;
   
  -import java.text.DateFormat;
  -import java.text.SimpleDateFormat;
  -import java.util.Calendar;
  -import java.util.Locale;
  -import java.util.TimeZone;
   import java.util.Vector;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Task;
  +import org.apache.tools.ant.util.DateUtils;
   
   /**
    * Base class for the various emailing implementations.
  @@ -81,9 +77,6 @@
       protected Task task;
       protected boolean includeFileNames = false;
   
  -    private static DateFormat df =
  -        new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss ", Locale.US);
  -
       /**
        * Sets the mail server
        *
  @@ -209,27 +202,7 @@
        * @since Ant 1.5
        */
       protected final String getDate() {
  -        Calendar cal = Calendar.getInstance();
  -        TimeZone tz = cal.getTimeZone();
  -        int offset = tz.getOffset(cal.get(Calendar.ERA), 
  -                                  cal.get(Calendar.YEAR),
  -                                  cal.get(Calendar.MONTH),
  -                                  cal.get(Calendar.DAY_OF_MONTH),
  -                                  cal.get(Calendar.DAY_OF_WEEK),
  -                                  cal.get(Calendar.MILLISECOND));
  -        StringBuffer tzMarker = new StringBuffer(offset < 0 ? "-" : "+");
  -        offset = Math.abs(offset);
  -        int hours = offset / (60 * 60 * 1000);
  -        int minutes = offset / (60 * 1000) - 60 * hours;
  -        if (hours < 10) {
  -            tzMarker.append("0");
  -        }
  -        tzMarker.append(hours);
  -        if (minutes < 10) {
  -            tzMarker.append("0");
  -        }
  -        tzMarker.append(minutes);
  -        return df.format(cal.getTime()) + tzMarker.toString();
  +        return DateUtils.getDateForHeader();
       }
   }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message