andreiDamoc / googletransitdatafeed

Automatically exported from code.google.com/p/googletransitdatafeed
0 stars 0 forks source link

Index Out Of Bounds Exception #329

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Running transxchange2GTFS for any of the files in here: 
http://opendb.steven.hosting.pyro.eu.org/datasets/nptdr/files/TXC/Admin_Area_490
/

What is the expected output? What do you see instead?

I get an exception:
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1716, 
Size: 1
    at java.util.ArrayList.RangeCheck(ArrayList.java:547)
    at java.util.ArrayList.get(ArrayList.java:322)
    at transxchange2GoogleTransitHandler.TransxchangeCalendar.calendarDuplicateService(TransxchangeCalendar.java:565)
    at transxchange2GoogleTransitHandler.TransxchangeTrips$1TripStructure.createTripStructure(TransxchangeTrips.java:228)
    at transxchange2GoogleTransitHandler.TransxchangeTrips.endElement(TransxchangeTrips.java:280)
    at transxchange2GoogleTransitHandler.TransxchangeHandlerEngine.endElement(TransxchangeHandlerEngine.java:343)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:331)
    at transxchange2GoogleTransitHandler.TransxchangeHandler.parse(TransxchangeHandler.java:164)
    at Transxchange2GoogleTransit.main(Transxchange2GoogleTransit.java:101)

What version of the product are you using? On what operating system?

I am using version 1.7.4 on Ubuntu

Original issue reported on code.google.com by johngou...@gmail.com on 21 May 2012 at 12:54

GoogleCodeExporter commented 8 years ago

Original comment by Joachim....@gmail.com on 28 May 2012 at 8:18

GoogleCodeExporter commented 8 years ago
Hi John,
This is data for Greater London (area 490), dating back to 2010. 
Transport for London since releases TransXChange network and schedule data here:
http://www.tfl.gov.uk/businessandpartners/syndication/16492.aspx
Check "Journey Planner Timetables" and fill out the form. 
I pull the TfL data once a month and convert it. Here is a writeup how I go 
about converting the TfL data:
http://code.google.com/p/googletransitdatafeed/wiki/LondonTXC2GTFS
It is not trivial, bring time.

Original comment by Joachim....@gmail.com on 31 May 2012 at 3:20

GoogleCodeExporter commented 8 years ago
Attached is a patch which I wrote to prevent this from happening. I pulled the 
trunk yesterday which is after the code is supposed to have been fixed?

While my patch prevents this exception from being thrown and so processing 
succeeds I am not certain that it will result in correct output.
This is one of a fairly large number of patches that I wrote yesterday, 
hopefully it doesn't depend on one of the earlier ones.

Original comment by scottish...@googlemail.com on 8 Jun 2012 at 8:55

Attachments: