Patch: Remove exception catching from normal path in Arrays.equals.

Andrew Haley aph@redhat.com
Mon Sep 8 11:16:00 GMT 2003


Andrew Haley writes:
 > Mohan Embar writes:
 >  > 
 >  > While we're on this subject, there are myriad places (natClass.cc,
 >  > natRuntime.cc, natArray.cc, natConstructor.cc, natField.cc, natMethod.cc,
 >  > natResourceBundle.cc) where gnu.gcj.StackTrace is being used
 >  > like this (example from natArray.cc):
 >  > 
 >  > try
 >  > {
 >  >   for (int i = 1; !caller; i++)
 >  >     {
 >  >       caller = t->classAt (i);
 >  >     }
 >  >   caller_loader = caller->getClassLoaderInternal();
 >  > }
 >  > catch (::java::lang::ArrayIndexOutOfBoundsException *e)
 >  > {
 >  > }
 >  
 > Note that the catch clause will not be invoked unless there is a bug in gcj.

... so the last part should perhaps read

catch (::java::lang::ArrayIndexOutOfBoundsException *e)
{
  throw new RuntimeError (e);
}

Andrew.



More information about the Java-patches mailing list