//# 0 errors, 63 messages
//#
/*
    //#emailnotificationlistener.java:1:1: class: net.sourceforge.pebble.event.comment.EmailNotificationListener
    //#emailnotificationlistener.java:1:1: method: net.sourceforge.pebble.event.comment.EmailNotificationListener.net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.event.comment;

import net.sourceforge.pebble.domain.Comment;

import java.util.Collection;
import java.util.HashSet;

/**
 * Sends an e-mail notification to the blog owners when new
 * comments are added.
 *
 * @author Simon Brown
 */
public class EmailNotificationListener extends AbstractEmailNotificationListener {
    //#emailnotificationlistener.java:45: method: void net.sourceforge.pebble.event.comment.EmailNotificationListener.net.sourceforge.pebble.event.comment.EmailNotificationListener()
    //#input(void net.sourceforge.pebble.event.comment.EmailNotificationListener()): this
    //#emailnotificationlistener.java:45: end of method: void net.sourceforge.pebble.event.comment.EmailNotificationListener.net.sourceforge.pebble.event.comment.EmailNotificationListener()

  /**
   * Returns the collection of recipients.
   *
   * @param comment   the Comment from the event
   * @return  a Collection of e-mail addresses (Strings)
   */
  protected Collection getEmailAddresses(Comment comment) {
    Collection to = new HashSet();
    //#emailnotificationlistener.java:54: method: Collection net.sourceforge.pebble.event.comment.EmailNotificationListener.getEmailAddresses(Comment)
    //#input(Collection getEmailAddresses(Comment)): comment
    //#input(Collection getEmailAddresses(Comment)): comment.__Tag
    //#input(Collection getEmailAddresses(Comment)): comment.blogEntry
    //#input(Collection getEmailAddresses(Comment)): comment.blogEntry.__Tag
    //#input(Collection getEmailAddresses(Comment)): comment.blogEntry.blog
    //#input(Collection getEmailAddresses(Comment)): comment.blogEntry.blog.__Tag
    //#input(Collection getEmailAddresses(Comment)): comment.blogEntry.blog.properties
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[net/sourceforge/pebble/domain/Blog]
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[others]
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/Blog.__Dispatch_Table.getEmail()Ljava/lang/String;
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/Blog.__Dispatch_Table.getEmailAddresses()Ljava/util/Collection;
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[others]
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getBlog()Lnet/sourceforge/pebble/domain/Blog;
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/Comment.__Descendant_Table[net/sourceforge/pebble/domain/Comment]
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/Comment.__Descendant_Table[others]
    //#input(Collection getEmailAddresses(Comment)): net/sourceforge/pebble/domain/Comment.__Dispatch_Table.getBlogEntry()Lnet/sourceforge/pebble/domain/BlogEntry;
    //#output(Collection getEmailAddresses(Comment)): new HashSet(getEmailAddresses#1) num objects
    //#output(Collection getEmailAddresses(Comment)): return_value
    //#new obj(Collection getEmailAddresses(Comment)): new HashSet(getEmailAddresses#1)
    //#pre[1] (Collection getEmailAddresses(Comment)): comment != null
    //#pre[2] (Collection getEmailAddresses(Comment)): comment.__Tag == net/sourceforge/pebble/domain/Comment
    //#pre[3] (Collection getEmailAddresses(Comment)): comment.blogEntry != null
    //#pre[4] (Collection getEmailAddresses(Comment)): comment.blogEntry.__Tag == net/sourceforge/pebble/domain/BlogEntry
    //#pre[5] (Collection getEmailAddresses(Comment)): comment.blogEntry.blog != null
    //#pre[6] (Collection getEmailAddresses(Comment)): comment.blogEntry.blog.__Tag == net/sourceforge/pebble/domain/Blog
    //#pre[7] (Collection getEmailAddresses(Comment)): comment.blogEntry.blog.properties != null
    //#post(Collection getEmailAddresses(Comment)): return_value == &new HashSet(getEmailAddresses#1)
    //#post(Collection getEmailAddresses(Comment)): new HashSet(getEmailAddresses#1) num objects == 1
    //#unanalyzed(Collection getEmailAddresses(Comment)): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(Collection getEmailAddresses(Comment)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(Collection getEmailAddresses(Comment)): Effects-of-calling:java.util.Arrays:asList
    to.addAll(comment.getBlogEntry().getBlog().getEmailAddresses());

    return to;
    //#emailnotificationlistener.java:57: end of method: Collection net.sourceforge.pebble.event.comment.EmailNotificationListener.getEmailAddresses(Comment)
  }

}
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/comment/EmailNotificationListener]
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.commentAdded(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.commentApproved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.commentRejected(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.commentRemoved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.getEmailAddresses(Lnet/sourceforge/pebble/domain/Comment;)Ljava/util/Collection;
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.sendApprovalRequest(Lnet/sourceforge/pebble/domain/Comment;)V
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.sendNotification(Lnet/sourceforge/pebble/domain/Comment;)V
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): net/sourceforge/pebble/api/event/comment/CommentListener.__Descendant_Table[net/sourceforge/pebble/event/comment/EmailNotificationListener]
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): net/sourceforge/pebble/event/comment/AbstractEmailNotificationListener.__Descendant_Table[net/sourceforge/pebble/event/comment/EmailNotificationListener]
    //#output(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): net/sourceforge/pebble/event/comment/CommentListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/comment/EmailNotificationListener]
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/comment/EmailNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): net/sourceforge/pebble/api/event/comment/CommentListener.__Descendant_Table[net/sourceforge/pebble/event/comment/EmailNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): net/sourceforge/pebble/event/comment/AbstractEmailNotificationListener.__Descendant_Table[net/sourceforge/pebble/event/comment/EmailNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): net/sourceforge/pebble/event/comment/CommentListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/comment/EmailNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.commentAdded(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V == &net/sourceforge/pebble/event/comment/AbstractEmailNotificationListener.commentAdded
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.commentApproved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V == &net/sourceforge/pebble/event/comment/AbstractEmailNotificationListener.commentApproved
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.commentRejected(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V == &net/sourceforge/pebble/event/comment/CommentListenerSupport.commentRejected
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.commentRemoved(Lnet/sourceforge/pebble/api/event/comment/CommentEvent;)V == &net/sourceforge/pebble/event/comment/CommentListenerSupport.commentRemoved
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.getEmailAddresses(Lnet/sourceforge/pebble/domain/Comment;)Ljava/util/Collection; == &getEmailAddresses
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.sendApprovalRequest(Lnet/sourceforge/pebble/domain/Comment;)V == &net/sourceforge/pebble/event/comment/AbstractEmailNotificationListener.sendApprovalRequest
    //#post(net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init): __Dispatch_Table.sendNotification(Lnet/sourceforge/pebble/domain/Comment;)V == &net/sourceforge/pebble/event/comment/AbstractEmailNotificationListener.sendNotification
    //#emailnotificationlistener.java:: end of method: net.sourceforge.pebble.event.comment.EmailNotificationListener.net.sourceforge.pebble.event.comment.EmailNotificationListener__static_init
    //#emailnotificationlistener.java:: end of class: net.sourceforge.pebble.event.comment.EmailNotificationListener
