//# 1 errors, 72 messages
//#
/*
    //#emailauthornotificationlistener.java:1:1: class: net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener
    //#emailauthornotificationlistener.java:1:1: method: net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener.net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__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.BlogEntry;
import net.sourceforge.pebble.domain.TrackBack;

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

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

  /**
   * Returns the collection of recipients.
   *
   * @param trackBack   the TrackBack from the event
 T  * @return  a Collection of e-mail addresses (Strings)
   */
  protected Collection getEmailAddresses(TrackBack trackBack) {
    BlogEntry blogEntry = trackBack.getBlogEntry();
    //#emailauthornotificationlistener.java:55: method: Collection net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener.getEmailAddresses(TrackBack)
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/Configuration.__Descendant_Table[net/sourceforge/pebble/Configuration]
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/Configuration.__Descendant_Table[others]
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/Configuration.__Dispatch_Table.getSecurityRealm()Lnet/sourceforge/pebble/security/SecurityRealm;
    //#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.getAuthor()Ljava/lang/String;
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getUser()Lnet/sourceforge/pebble/security/PebbleUserDetails;
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/domain/PageBasedContent.__Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/domain/PageBasedContent.__Descendant_Table[net/sourceforge/pebble/domain/PageBasedContent]
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/domain/PageBasedContent.__Descendant_Table[net/sourceforge/pebble/domain/StaticPage]
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/domain/PageBasedContent.__Descendant_Table[others]
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/domain/PageBasedContent.__Dispatch_Table.getAuthor()Ljava/lang/String;
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/domain/PageBasedContent.log
    //#input(Collection getEmailAddresses(TrackBack)): net/sourceforge/pebble/domain/StaticPage.__Dispatch_Table.getAuthor()Ljava/lang/String;
    //#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.author
    //#input(Collection getEmailAddresses(TrackBack)): trackBack.blogEntry.user
    //#output(Collection getEmailAddresses(TrackBack)): new HashSet(getEmailAddresses#1) num objects
    //#output(Collection getEmailAddresses(TrackBack)): return_value
    //#output(Collection getEmailAddresses(TrackBack)): trackBack.blogEntry.user
    //#new obj(Collection getEmailAddresses(TrackBack)): new HashSet(getEmailAddresses#1)
    //#pre[1] (Collection getEmailAddresses(TrackBack)): init'ed(trackBack.blogEntry.user)
    //#pre[2] (Collection getEmailAddresses(TrackBack)): trackBack != null
    //#pre[3] (Collection getEmailAddresses(TrackBack)): trackBack.__Tag == net/sourceforge/pebble/domain/TrackBack
    //#pre[4] (Collection getEmailAddresses(TrackBack)): trackBack.blogEntry != null
    //#pre[5] (Collection getEmailAddresses(TrackBack)): (soft) trackBack.blogEntry.__Tag == net/sourceforge/pebble/domain/BlogEntry
    //#pre[6] (Collection getEmailAddresses(TrackBack)): (soft) init'ed(trackBack.blogEntry.author)
    //#post(Collection getEmailAddresses(TrackBack)): return_value == &new HashSet(getEmailAddresses#1)
    //#post(Collection getEmailAddresses(TrackBack)): trackBack.blogEntry.user != null
    //#post(Collection getEmailAddresses(TrackBack)): new HashSet(getEmailAddresses#1) num objects == 1
    //#unanalyzed(Collection getEmailAddresses(TrackBack)): Effects-of-calling:net.sourceforge.pebble.PebbleContext:getInstance
    //#unanalyzed(Collection getEmailAddresses(TrackBack)): Effects-of-calling:net.sourceforge.pebble.PebbleContext:getConfiguration
    //#unanalyzed(Collection getEmailAddresses(TrackBack)): Effects-of-calling:getSecurityRealm
    //#unanalyzed(Collection getEmailAddresses(TrackBack)): Effects-of-calling:net.sourceforge.pebble.security.SecurityRealm:getUser
    //#unanalyzed(Collection getEmailAddresses(TrackBack)): Effects-of-calling:org.apache.commons.logging.Log:error
    Collection<String> to = new HashSet<String>();
    to.add(blogEntry.getUser().getEmailAddress());
    //#emailauthornotificationlistener.java:57: ?null dereference
    //#    getUser(...) != null
    //#    severity: MEDIUM
    //#    class: net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener
    //#    method: Collection getEmailAddresses(TrackBack)
    //#    basic block: Entry_BB_1
    //#    assertion: getUser(...) != null
    //#    VN: getUser(...)
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
    //#emailauthornotificationlistener.java:57: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.security.PebbleUserDetails:getEmailAddress()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener
    //#    method: Collection getEmailAddresses(TrackBack)
    //#    unanalyzed callee: String net.sourceforge.pebble.security.PebbleUserDetails:getEmailAddress()

    return to;
    //#emailauthornotificationlistener.java:59: end of method: Collection net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener.getEmailAddresses(TrackBack)
  }

}
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/trackback/EmailAuthorNotificationListener]
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Dispatch_Table.getEmailAddresses(Lnet/sourceforge/pebble/domain/TrackBack;)Ljava/util/Collection;
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Dispatch_Table.sendNotification(Lnet/sourceforge/pebble/domain/TrackBack;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Dispatch_Table.trackBackAdded(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Dispatch_Table.trackBackApproved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Dispatch_Table.trackBackRejected(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Dispatch_Table.trackBackRemoved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): net/sourceforge/pebble/api/event/trackback/TrackBackListener.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailAuthorNotificationListener]
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): net/sourceforge/pebble/event/trackback/AbstractEmailNotificationListener.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailAuthorNotificationListener]
    //#output(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): net/sourceforge/pebble/event/trackback/TrackBackListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailAuthorNotificationListener]
    //#post(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Descendant_Table[net/sourceforge/pebble/event/trackback/EmailAuthorNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): net/sourceforge/pebble/api/event/trackback/TrackBackListener.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailAuthorNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): net/sourceforge/pebble/event/trackback/AbstractEmailNotificationListener.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailAuthorNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): net/sourceforge/pebble/event/trackback/TrackBackListenerSupport.__Descendant_Table[net/sourceforge/pebble/event/trackback/EmailAuthorNotificationListener] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Dispatch_Table.getEmailAddresses(Lnet/sourceforge/pebble/domain/TrackBack;)Ljava/util/Collection; == &getEmailAddresses
    //#post(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init): __Dispatch_Table.sendNotification(Lnet/sourceforge/pebble/domain/TrackBack;)V == &net/sourceforge/pebble/event/trackback/AbstractEmailNotificationListener.sendNotification
    //#post(net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__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.EmailAuthorNotificationListener__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.EmailAuthorNotificationListener__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.EmailAuthorNotificationListener__static_init): __Dispatch_Table.trackBackRemoved(Lnet/sourceforge/pebble/api/event/trackback/TrackBackEvent;)V == &net/sourceforge/pebble/event/trackback/TrackBackListenerSupport.trackBackRemoved
    //#emailauthornotificationlistener.java:: end of method: net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener.net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener__static_init
    //#emailauthornotificationlistener.java:: end of class: net.sourceforge.pebble.event.trackback.EmailAuthorNotificationListener
