CVS update: JGroups/src/org/jgroups Message.java

"Bela Ban" <[email protected]>
Newsgroups gmane.comp.java.javagroups.cvs
Message-ID <[email protected]>
  User: belaban 
  Date: 10/08/31 12:23:18

  Modified:    src/org/jgroups Message.java
  Log:
  throwing exception on getting / setting a header with id <= 0
  
  Revision  Changes    Path
  1.117     +3 -3      JGroups/src/org/jgroups/Message.java
  
  Index: Message.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/Message.java,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- Message.java	18 Aug 2010 08:39:31 -0000	1.116
  +++ Message.java	31 Aug 2010 12:23:18 -0000	1.117
  @@ -26,7 +26,7 @@
    * The byte buffer can point to a reference, and we can subset it using index and length. However,
    * when the message is serialized, we only write the bytes between index and length.
    * @author Bela Ban
  - * @version $Id: Message.java,v 1.116 2010/08/18 08:39:31 belaban Exp $
  + * @version $Id: Message.java,v 1.117 2010/08/31 12:23:18 belaban Exp $
    */
   public class Message implements Streamable {
       protected Address dest_addr;
  @@ -385,7 +385,7 @@
        *         if the implementation supports null values.)
        */
       public Header putHeaderIfAbsent(short id, Header hdr) {
  -        if(id < 0)
  +        if(id <= 0)
               throw new IllegalArgumentException("An ID of " + id + " is invalid");
           return headers.putHeaderIfAbsent(id, hdr);
       }
  @@ -402,7 +402,7 @@
       }
   
       public Header getHeader(short id) {
  -        if(id < 0)
  +        if(id <= 0)
               throw new IllegalArgumentException("An ID of " + id + " is invalid");
           return headers.getHeader(id);
       }
  
  
  

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.