W3C home > Mailing lists > Public > www-rdf-comments@w3.org > January to March 1999

Bug in the SirPAC compiler

From: Tod Creasey OTT <Tod_Creasey@oti.com>
Date: Tue, 02 Mar 1999 09:17:48 -0500
To: www-rdf-comments@w3.org (W3 RDF Comments)
Message-ID: <1999Mar02.092000.1250.1096594@otismtp.ott.oti.com>

 When running the version 1.9 of SiRPAC over your examples you always get an 
index out of range error for an index far higher than the largest index of 
the file that you are parsing.

Here is the problem in the SiRPAC method characters(char[],in,int)

     public void characters (char ch[], int start, int length)
     throws SAXException {

     /**
      * Place all characters as Data instance to the containment
      * hierarchy with the help of the stack.
      */
     Element e = (Element)m_elementStack.peek ();
     String s = new String (ch, start, length+start);


which should read

     public void characters (char ch[], int start, int length)
     throws SAXException {

     /**
      * Place all characters as Data instance to the containment
      * hierarchy with the help of the stack.
      */
     Element e = (Element)m_elementStack.peek ();
     String s = new String (ch, start, length);

As the method for creating the new String takes a length not an offset count 
as the last parameter.

Tod

Tod Creasey
Software Developer
Object Technology International Inc.
2670 Queensview Drive
Ottawa, Ontario
K28 8K1
Received on Tuesday, 2 March 1999 09:20:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 21 September 2012 14:16:26 GMT