This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]