Bug 36336 - java.lang.StringIndexOutOfBoundsException: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Status: RESOLVED FIXED
Product: Tomcat 5
Classification: Unclassified
Component: Webapps:Manager
5.5.9
PC Windows 2000
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2005-08-24 14:35 UTC by A.Grasoff
Modified: 2005-10-12 21:49 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description A.Grasoff 2005-08-24 14:35:29 UTC
Hi,

When I deploy (/manager) some web-application with extension .WAR (uppercase)
then I see:

SEVERE: HTMLManager: FAIL - Deploy Upload Failed, Exception: String index out of
range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(Unknown Source)
	at
org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:194)

In source of HTMLManagerServlet:

194: basename = war.substring(0, war.indexOf(".war")); // no lowerCase

BUT:

180: if (!war.toLowerCase().endsWith(".war")) // lowerCase

---
May be is better make so:

194: basename = war.substring(0, war.toLowerCase().indexOf(".war"));

Thanks.

Anton.

PS I am sorry for my English :)
Comment 1 Yoav Shapira 2005-10-13 05:49:30 UTC
Don't worry about your English ;)  Good catch, good recommendation, I've applied
it for 5.5.13.  Thank you ;)