Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#4950 closed defect (fixed)

Bad loop over attribute list

Reported by: anonymous Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: gcj Cc:


file :src/org/openstreetmap/josm/io/

line 124: for (int i=0; i< qName.length(); i++) {

it loops over the chars in the string to get the attributes, this causes an out of bounds error.

the code should be :

for (int i=0; i< atts.getLength(); i++) {

see my code changes here :

error message :
Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.raiseBoundsError(
at java.util.ArrayList.checkBoundExclusive(
at java.util.ArrayList.get(

This is why we should be testing with the gcj because it catches such sloppy code.

Attachments (0)

Change History (2)

comment:1 Changed 13 years ago by bastiK

Resolution: fixed
Status: newclosed

(In [3212]) fixed #4950 - Bad loop over attribute list (patch by jamesmikedupont)

comment:2 Changed 13 years ago by stoecker

Ticket #4804 has been marked as a duplicate of this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.