[Patch] natString.cc: Some fixes for bounds checking arithmetic.

Ralph Loader suckfish@ihug.co.nz
Tue Sep 23 20:40:00 GMT 2003


> I was wondering about a similar thing in kaffe, and it may be saner to 
> write the array index argument checking code once in a final class in 
> Java and/or a static inline method in C++/function in C and let the 
> compiler do the inlining magic.

Sounds good in theory.  A couple of issues to deal with in practice:

- sometimes you have start and length, sometimes you have start and
end.  The APIs aren't consistent.

- how good is the java compiler at inlining?

- there's 3 different exception classes, IndexOutOfBoundsException,
ArrayIndex... and StringIndex...  Again, the APIs don't seem
particularly consistent about which should get thrown.

Ralph.




More information about the Java-patches mailing list