[Yanel-dev] Re: [Yanel-commits] rev 47279 - public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/resources

Michael Wechner michael.wechner at wyona.com
Thu Jan 28 09:31:54 CET 2010


Guillaume Déflache wrote:
> Hi!
>
> michi at wyona.com a écrit :
>> Author: michi
>> Date: 2010-01-27 12:14:31 +0100 (Wed, 27 Jan 2010)
>> New Revision: 47279
>>
>> Modified:
>>    
>> public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/resources/BasicFormResource.java 
>>
>> Log:
>> use MailUtil for sending emails
>>
>> Modified: 
>> public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/resources/BasicFormResource.java 
>>
>> ===================================================================
>> --- 
>> public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/resources/BasicFormResource.java    
>> 2010-01-27 11:13:58 UTC (rev 47278)
>> +++ 
>> public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/resources/BasicFormResource.java    
>> 2010-01-27 11:14:31 UTC (rev 47279)
>> @@ -141,6 +141,8 @@
>>      }
>>           /**
>> +     * @deprecated Use org.wyona.yanel.core.util.MailUtil.send() 
>> instead
>> +     *
>>       * Sends an email. E.g. use this method to send confirmation mails.
>>       *       * @param from sender email address
>> @@ -150,6 +152,11 @@
>>       * @param content email content
>>       */
>>      protected void sendMail(String from, String replyTo, String to, 
>> String subject, String content) throws Exception {
>> +        log.warn("DEPRECATED");
>> +        org.wyona.yanel.core.util.MailUtil.send(from, replyTo, to, 
>> subject, content);
>> +
>> +
>> +/*
>>          // Create a mail session
>>          java.util.Properties props = new java.util.Properties();
>>          props.put("mail.smtp.host", 
>> getResourceConfigProperty("smtpHost"));
>> @@ -170,14 +177,17 @@
>>          msg.setRecipient(Message.RecipientType.TO, new 
>> InternetAddress(to));
>>          msg.setSubject(subject);
>>          msg.setText(content);
>> +*/
>>  
>>  /*
>>          msg.setSubject(subject,"utf-8");
>>          msg.setContent(content, "text/plain;charset=utf-8");
>>  */
>>  
>> +/*
>>          // Send the message
>>          Transport.send(msg);
>> +*/
>>      }
>>           /**
>>
>
> Why comment this code instead of simply deleting it?

because  I am not sure if it contains stuff (like the utf-8) which is 
still needed (in case further tests reveal issues)
and my experience showed that it can be very inconvenient to search for 
code within SVN revisions.

I don't think it hurts as much as it helps and at some point in time it 
will be removed.

Maybe you have also noticed that I continuously clean code.

Thanks

Michi
>
> Cheers,
>    Guillaume



More information about the Yanel-development mailing list