List Info

Thread: DO NOT REPLY - IndexOutOfBounds exception in when the URI is invalid




DO NOT REPLY - IndexOutOfBounds exception in <scp> when the URI is invalid
country flaguser name
United States
2007-09-02 15:03:22
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42
770>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42770





------- Additional Comments From sjjohnscox.net 
2007-09-02 13:03 -------
Created an attachment (id=20754)
 --> (http://issues.apache.org/bugzilla/attac
hment.cgi?id=20754&action=view)
Patch to throw an appropriate exception when remoteToDir()
gets an invalid URI.


Here's a patch that does what Steve mentions.  

I added a check in setRemoteTodir() to throw a
BuildException with a
descriptive message when the URI does not contain an ''
symbol.

For good measure, I added some code in parseUri() at the
point where the
StringIndexOutOfBoundsException was being thrown to skip the
indexOf() call if
the index is negative.	And instead throw a BuildException
explaining the
remote URI was invalid.

I also added a unit test to ScpTest.java to exercise the new
code.  

While testing the unit test, I found an apparent bug in
ScpTest.testSingleFileUploadAndDownload().  I added a line
to fix that. 

Let me know what you think.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=ema
il
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )