ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5273] - Mail task throws IndexOutOfBoundsException on send QUIT
Date Thu, 06 Dec 2001 21:53:34 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5273>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5273

Mail task throws IndexOutOfBoundsException on send QUIT





------- Additional Comments From william_ferguson@versata.com  2001-12-06 13:53 -------
The offending line is
            result.append(line.substring(0, 3));
which is line 87 in the source I have.
Since the source can only be downloaded from the Nightly build section it is 
probably slightly newer than 1.4.1

But this is the staktrace I get using the a straight Ant 1.4.1 install

java.lang.StringIndexOutOfBoundsException: String index out of range: 3
        at java.lang.String.substring(String.java:1522)
        at org.apache.tools.mail.SmtpResponseReader.getResponse
(SmtpResponseReader.java:87)
        at org.apache.tools.mail.MailMessage.send(MailMessage.java:374)
        at org.apache.tools.mail.MailMessage.sendQuit(MailMessage.java:368)
        at org.apache.tools.mail.MailMessage.sendAndClose(MailMessage.java:279)
        at org.apache.tools.ant.taskdefs.SendEmail.execute(SendEmail.java:246)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        at org.apache.tools.ant.Target.execute(Target.java:164)
        at org.apache.tools.ant.Target.performTasks(Target.java:182)
        at org.apache.tools.ant.Project.executeTarget(Project.java:601)
        at org.apache.tools.ant.Project.executeTargets(Project.java:560)
        at org.apache.tools.ant.Main.runBuild(Main.java:454)
        at org.apache.tools.ant.Main.start(Main.java:153)
        at org.apache.tools.ant.Main.main(Main.java:176)


It the substring that is throwing the IndexOutOfBounds.
As will the other uses of substring, and charAt in this class, as none of them 
check for String length first.

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message