Ignore:
Timestamp:
10/06/20 13:12:20 (4 years ago)
Author:
bart
Message:

Fixes an issue with processing maxPower of a vote. Javadoc maven plugin now uses latest version.

Location:
events/src/main/java/geniusweb
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • events/src/main/java/geniusweb/actions/Votes.java

    r21 r24  
    5757         * with power at most P.
    5858         *
    59          * @param otherVotes
     59         * @param otherVotes the {@link Votes}, usually from a previous round, that
     60         *                   this should extend.
    6061         * @return true iff this extends the otherVotes.
    6162         */
     
    6566                for (Vote vote : otherVotes.getVotes()) {
    6667                        Vote myvote = getVote(vote.getBid());
    67                         if (myvote == null)
    68                                 return false;
    69                         if (myvote.getMinPower() > vote.getMinPower())
     68                        if (myvote == null || myvote.getMinPower() > vote.getMinPower()
     69                                        || myvote.getMaxPower() < vote.getMaxPower())
    7070                                return false;
    7171                }
  • events/src/main/java/geniusweb/events/ActionEvent.java

    r1 r24  
    1818        /**
    1919         *
    20          * @param action
     20         * @param action the {@link Action} that was done
    2121         * @param time   the current time to use. see
    2222         *               {@link System#currentTimeMillis()}.
  • events/src/main/java/geniusweb/events/NegotiationEvent.java

    r1 r24  
    66import com.fasterxml.jackson.annotation.JsonTypeInfo;
    77import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
     8
     9import geniusweb.actions.Action;
    810
    911/**
  • events/src/main/java/geniusweb/inform/Agreements.java

    r21 r24  
    5151
    5252        /**
    53          * @param bid
    54          * @param parties
     53         * @param bid     a {@link Bid} to be added
     54         * @param parties {@link Set} of the {@link PartyId}s that accepted the bid
    5555         * @return new Agreements, with the new bid/parties added.
    5656         */
  • events/src/main/java/geniusweb/inform/Finished.java

    r21 r24  
    1515         * The session finished (can be for any reason).
    1616         *
    17          * @param agreedBid the bid that was finally agreed on; null if no
    18          *                  agreement.
     17         * @param agreements the {@link Agreements} that were finally agreed on.
    1918         */
    2019        @JsonCreator
    2120        public Finished(@JsonProperty("agreements") Agreements agreements) {
     21                if (agreements == null)
     22                        throw new NullPointerException("Agreements can't be null");
    2223                this.agreements = agreements;
    2324        }
  • events/src/main/java/geniusweb/inform/Inform.java

    r21 r24  
    77
    88/**
    9  * base class of all information sent to the {@link Party}
     9 * base class of all information sent to a Party
    1010 */
    1111@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
  • events/src/main/java/geniusweb/inform/Settings.java

    r21 r24  
    22
    33import java.util.HashMap;
     4import java.util.Map;
    45
    56import com.fasterxml.jackson.annotation.JsonCreator;
     
    1314
    1415/**
    15  * Informs a {@link Party} about all settings for the upcoming negotiation
    16  * session. This should be sent to a party one time, so that the party knows the
    17  * situation.
     16 * Informs a Party about all settings for the upcoming negotiation session. This
     17 * should be sent to a party one time, so that the party knows the situation.
    1818 *
    1919 */
     
    3131         * @param protocol   the protocol used in this session
    3232         * @param progress   the {@link Progress} object used for this session
    33          * @param parameters a Map<String, Object> containing initialization
    34          *                   parameters for this party. The Object can be a HashMap,
    35          *                   ArrayList, String, or number (Integer, Double, etc).
    36          *                   The Object should not be just any Object because
    37          *                   deserialization will work only with the mentioned
    38          *                   types.
     33         * @param parameters a {@link Map} &lt;String, Object&gt; containing
     34         *                   initialization parameters for this party. The Object
     35         *                   can be a HashMap, ArrayList, String, or number
     36         *                   (Integer, Double, etc). The Object should not be just
     37         *                   any Object because deserialization will work only with
     38         *                   the mentioned types.
    3939         */
    4040        @JsonCreator
     
    8585        /**
    8686         *
    87          * @return a HashMap<String,Object> containing initialization parameters
    88          *         that can be used by the party.
     87         * @return a {@link HashMap}&lt;String,Object&gt; containing initialization
     88         *         parameters that can be used by the party.
    8989         */
    9090        public HashMap<String, Object> getParameters() {
Note: See TracChangeset for help on using the changeset viewer.