iandees/xapi-servlet

String index out of range

pnorman opened this issue · 0 comments

With the query

*[poly=_x~|H_|sR~reKzphR~qy@ryvK~f{C_xq@_cmAntqb@_ibE~~oR_{aP~p~I_ykb@m_vW_dyKqrdi@?_~n J~_kIvp[~b~TwchC~sqU_twM]

An error is returned

java.lang.StringIndexOutOfBoundsException: String index out of range: 105
    at java.lang.String.charAt(String.java:695)
    at com.yellowbkpk.geo.xapi.query.XAPIQueryInfo.parsePolygonRHS(XAPIQueryInfo.java:543)
    at com.yellowbkpk.geo.xapi.query.XAPIQueryInfo.parseSelector(XAPIQueryInfo.java:193)
    at com.yellowbkpk.geo.xapi.query.XAPIQueryInfo.parseBracketedSelector(XAPIQueryInfo.java:176)
    at com.yellowbkpk.geo.xapi.query.XAPIQueryInfo.fromString(XAPIQueryInfo.java:74)
    at com.yellowbkpk.geo.xapi.servlet.XapiServlet.doGet(XapiServlet.java:88)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

The command line issued is

curl -o uk.osm --globoff "http://localhost:8080/xapi/api/0.6/*[poly=_x~%7CH_%7CsR~reKzphR~qy%40ryvK~f%7BC_xq%40_cmAntqb%40_ibE~~oR_%7BaP~p~I_ykb%40m_vW_dyKqrdi%40%3F_~n%0AJ~_kIvp%5B~b~TwchC~sqU_twM]"