You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by pg...@apache.org on 2002/08/08 01:26:58 UTC

cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets GenericListserv.java

pgoldstein    2002/08/07 16:26:58

  Modified:    src/java/org/apache/james/transport/mailets
                        GenericListserv.java
  Log:
  Part of the String=>StringBuffer changes.  Includes some additional
  commenting, formatting fixes, and wrapping of logging calls in log
  level checks.  Also converted equalsIgnoreCase paradigm as discussed on
  mailing list.  Locale issue for both toUpperCase() and toLowerCase() was
  addressed as well.
  
  Revision  Changes    Path
  1.7       +21 -16    jakarta-james/src/java/org/apache/james/transport/mailets/GenericListserv.java
  
  Index: GenericListserv.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/GenericListserv.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- GenericListserv.java	20 Jun 2002 15:35:45 -0000	1.6
  +++ GenericListserv.java	7 Aug 2002 23:26:58 -0000	1.7
  @@ -106,26 +106,31 @@
   
               //Set the subject if set
               if (getSubjectPrefix() != null) {
  -                String prefix = "[" + getSubjectPrefix() + "]";
  +                StringBuffer prefixBuffer =
  +                    new StringBuffer(64)
  +                        .append("]")
  +                        .append(getSubjectPrefix())
  +                        .append("]");
  +                String prefix = prefixBuffer.toString();
                   String subj = message.getSubject();
                   if (subj == null) {
                       subj = "";
                   }
  -            //replace Re: with RE:
  -            String re ="Re:";
  -            int index = subj.indexOf(re);
  -            while(index > -1){
  -                subj = subj.substring(0, index) +"RE:"+ subj.substring(index + re.length() + 1);
  -                index = subj.indexOf(re);
  -            }
  -            //reduce them to one at the beginning
  -            re ="RE:";
  -            index = subj.indexOf(re,re.length());
  -            System.err.println("3i-"+index);
  -            while(index > 0){
  -                subj = subj.substring(0, index) + subj.substring(index + re.length() + 1);
  -                index = subj.indexOf(re,1);
  -            }
  +                //replace Re: with RE:
  +                String re ="Re:";
  +                int index = subj.indexOf(re);
  +                while(index > -1){
  +                    subj = subj.substring(0, index) + "RE:" + subj.substring(index + re.length() + 1);
  +                    index = subj.indexOf(re);
  +                }
  +                //reduce them to one at the beginning
  +                re ="RE:";
  +                index = subj.indexOf(re,re.length());
  +                System.err.println("3i-"+index);
  +                while(index > 0){
  +                    subj = subj.substring(0, index) + subj.substring(index + re.length() + 1);
  +                    index = subj.indexOf(re,1);
  +                }
                   //If the "prefix" is in the subject line, remove it and everything before it
                   index = subj.indexOf(prefix);
                   if (index > -1) {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>