MER-C/wiki-java

Patch for /trunk/src/org/wikipedia/Wiki.java

Closed this issue · 2 comments

commons.getImageHistory("File:Chief1.gif");
gives Exception in thread "main" java.lang.StringIndexOutOfBoundsException: 
String index out of range: -336
    at java.lang.String.substring(String.java:1911)
    at shared.Wiki.parseAttribute(Wiki.java:6731)
    at shared.Wiki.parseLogEntry(Wiki.java:4969)
    at shared.Wiki.getImageHistory(Wiki.java:3228)

A slightly more paranoid approach (adding a prefixed space) reduces such 
exceptions.

Original issue reported on code.google.com by jerm...@gmail.com on 6 Dec 2014 at 8:12

Attachments:

Other examples:
commons.getImageHistory("File:DFW_diagram.gif");
commons.getImageHistory("Alexander_P_Stewart.gif");
...

Original comment by jerm...@gmail.com on 6 Dec 2014 at 8:20

I've done exactly that in r222.

Original comment by stop.squark on 19 Mar 2015 at 11:52

  • Changed state: Fixed