From: <bc...@wo...> - 2000-10-26 14:41:24
|
I once wrote: >We may have a problem with JavaCC-2.0 on (some?) Macs. Frode Reinsnes >have tested errata-09 (which uses JavaCC-1.1) and encountered a >ArrayIndexOutOfBoundsException. > >http://www.python.org/pipermail/jpython-interest/2000-October/006356.html There are now more info available: [Frode Reinsnes] >I have trace the problem lintel more down. The problem is in FillBuff. and >the problem occure when you try to read one char in the last posison in the >buffer. That mean theat maxNextCharInd == bufsize-1. > > if ((i = inputStream.read(buffer, maxNextCharInd, > available - maxNextCharInd)) == -1) > > >A call to inputStream.read(buffer,buffer.length-1,1) will return a larg >negativ number. This is perhaps a bug in MRJ2.2? I would say it is a bug in MRJ2.2. It is however a bug that will hurt jython when used under that version of the JVM. The return value of Reader.read(b,o,l) is documented as: """ The number of characters read, or -1 if the end of the stream has been reached """ The inputStream is actually a new InputStreamReader( new BufferedInputStream( new FileInputStream(new File(modname + ".py")))) I suspect it is the ByteToCharConverter in the InputStreamReader, that somehow get confused and return a wrong length. I still have no clue what to do about it. regards, finn |