//# 0 errors, 61 messages
//#
/*
    //#emailnotificationlistener.java:1:1: class: net.sourceforge.pebble.event.trackback.EmailNotificationListener
    //#emailnotificationlistener.java:1:1: method: net.sourceforge.pebble.event.trackback.EmailNotificationListener.net.sourceforge.pebble.event.trackback.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.trackback;

import net.sourceforge.pebble.domain.TrackBack;

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

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

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

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

}
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/trackback/EmailNotificationListener]
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.getEmailAddresses(Lnet/sourceforge/pebble/domain/TrackBack;)Ljava/util/Collection;
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.sendNotification(Lnet/sourceforge/pebble/domain/TrackBack;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.trackBackAdded(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.trackBackApproved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.trackBackRejected(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.trackBackRemoved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): net/sourceforge/pebble/api/event/trackback/TrackBackListener.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailNotificationListener]
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): net/sourceforge/pebble/event/trackback/AbstractEmailNotificationListener.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailNotificationListener]
    //#output(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): net/sourceforge/pebble/event/trackback/TrackBackListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailNotificationListener]
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/trackback/EmailNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): net/sourceforge/pebble/api/event/trackback/TrackBackListener.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): net/sourceforge/pebble/event/trackback/AbstractEmailNotificationListener.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): net/sourceforge/pebble/event/trackback/TrackBackListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.getEmailAddresses(Lnet/sourceforge/pebble/domain/TrackBack;)Ljava/util/Collection; == &getEmailAddresses
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.sendNotification(Lnet/sourceforge/pebble/domain/TrackBack;)V == &net/sourceforge/pebble/event/trackback/AbstractEmailNotificationListener.sendNotification
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.trackBackAdded(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V == &net/sourceforge/pebble/event/trackback/AbstractEmailNotificationListener.trackBackAdded
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.trackBackApproved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V == &net/sourceforge/pebble/event/trackback/TrackBackListenerSupport.trackBackApproved
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.trackBackRejected(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V == &net/sourceforge/pebble/event/trackback/TrackBackListenerSupport.trackBackRejected
    //#post(net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init): __Dispatch_Table.trackBackRemoved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V == &net/sourceforge/pebble/event/trackback/TrackBackListenerSupport.trackBackRemoved
    //#emailnotificationlistener.java:: end of method: net.sourceforge.pebble.event.trackback.EmailNotificationListener.net.sourceforge.pebble.event.trackback.EmailNotificationListener__static_init
    //#emailnotificationlistener.java:: end of class: net.sourceforge.pebble.event.trackback.EmailNotificationListener
