On 1/4/06, Tino Schwarze <[EMAIL PROTECTED]> wrote:
> On Wed, Jan 04, 2006 at 07:48:43AM -0000, [EMAIL PROTECTED] wrote:
>
> > Modified: tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java
> > URL: 
> > http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java?rev=365858&r1=365857&r2=365858&view=diff
> > > > +            try {
> >           for( int srcPos=srcOff + 1; srcPos< srcEnd; ) {
> >                  if( bb.get(myPos++) != src.charAt( srcPos++ ))
> >                   break;
> >                  if( srcPos==srcEnd ) return i-start; // found it
> >           }
> > +            } catch( Throwable t ) {
> > +                t.printStackTrace();
> > +            }
>
> Argh! Never ever do that!
> 1) don't catch Throwable - you'll happily consume OutOfMemoryError and
>    similar bad things here which should certainly be passed along.
> 2) don't use printStackTrace() - use a suitable logger instead

Will go away - using the buffers is very messy right now, I'm trying
to find a better way.

Costin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to