classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Bug(s) in java.lang.String


From: Benenati, ChrisX J
Subject: RE: Bug(s) in java.lang.String
Date: Thu, 15 Aug 2002 09:02:51 -0700

Seems to fix the problem

> -----Original Message-----
> From: Mark Wielaard [mailto:address@hidden
> Sent: Wednesday, August 14, 2002 1:36 PM
> To: Benenati, ChrisX J
> Cc: 'address@hidden'
> Subject: Re: Bug(s) in java.lang.String
> 
> 
> Hi,
> 
> On Wed, Aug 14, 2002 at 01:10:00PM -0700, Benenati, ChrisX J wrote:
> > There seems to be a related problem with getBytes(String enc) and
> > getBytes().
> > 
> > Running under ORP, these methods are returning all of the 
> trailing nul bytes
> > as well as the valid characters in the String.
> 
> This seems like a bug in gnu.java.io.encode.Encoder.
> 
> Index: gnu/java/io/encode/Encoder.java
> ===================================================================
> RCS file: 
> /cvsroot/classpath/classpath/gnu/java/io/encode/Encoder.java,v
> retrieving revision 1.3
> diff -u -r1.3 Encoder.java
> --- gnu/java/io/encode/Encoder.java   22 Jan 2002 22:26:57 
> -0000 1.3
> +++ gnu/java/io/encode/Encoder.java   14 Aug 2002 20:27:41 -0000
> @@ -227,9 +227,9 @@
>  public byte[]
>  convertToBytes(char[] buf, int offset, int len) throws 
> CharConversionException
>  {
> -  byte[] bbuf = new byte[bytesInCharArray(buf)];
> +  byte[] bbuf = new byte[bytesInCharArray(buf, offset, len)];
>  
> -  return(convertToBytes(buf, offset, len, bbuf, offset));
> +  return(convertToBytes(buf, offset, len, bbuf, 0));
>  }
>  
>  
> /*************************************************************
> ************/
> 
> This was found by just reading the code since I am unable to 
> compile and
> test/run at the moment. So this might not be it. But if you 
> could try it
> out that would be highly appreciated.
> 
> Thanks,
> 
> Mark
> 
> -- 
> GNU/Linux is becoming popular for practical reasons. It's a 
> good system.
> The danger is people will like it because it's practical and 
> it will become
> popular without anyone having the vaguest idea of the ideals 
> behind it,
> which would be an ironic way of failing. 
<http://www.gnu.org/philosophy/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]