You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Eberhard Schulte <es...@pixelboxx.de> on 2004/03/16 09:48:39 UTC

Bug: axis-1.1/1.2, BoundaryDelimitedStream.java

Hello.

I have found a bug in axis-1.1/1.2
/org/apache/axis/attachments/BoundaryDelimitedStream.java

The implicite cast form byte to int is not correct.

      /**
       * Read from the boundary delimited stream.
       * @return The byte read, or -1 if endof stream.
       *
       * @throws java.io.IOException
       */
      public int read() throws java.io.IOException {

          byte[] b = new byte[1];    // quick and dirty. //for now
          int read = read(b);

          if (read < 0) {
              return -1;
          } else {
              // return b[0]; // wrong cast from byte to int
              return b[0] & 0xff;
          }
      }


Bye.

Schönen Gruß

Eberhard Schulte

------------------------------------------------
Eberhard Schulte
Senior Software Engineer
Pixelboxx GmbH          esc@pixelboxx.de
Ostenhellweg 56-58      http://www.pixelboxx.de/
44135 Dortmund          (02 31) 5 34 63-207
------------------------------------------------



Re: Bug: axis-1.1/1.2, BoundaryDelimitedStream.java

Posted by Steve Loughran <st...@iseran.com>.
Eberhard Schulte wrote:

> Hello.
> 
> I have found a bug in axis-1.1/1.2
> /org/apache/axis/attachments/BoundaryDelimitedStream.java
> 
> The implicite cast form byte to int is not correct.
> 
>      /**
>       * Read from the boundary delimited stream.
>       * @return The byte read, or -1 if endof stream.
>       *
>       * @throws java.io.IOException
>       */
>      public int read() throws java.io.IOException {
> 
>          byte[] b = new byte[1];    // quick and dirty. //for now
>          int read = read(b);
> 
>          if (read < 0) {
>              return -1;
>          } else {
>              // return b[0]; // wrong cast from byte to int
>              return b[0] & 0xff;
>          }
>      }
> 

patched, thanks!