What does destination String equal to?
have you changed it recently?


On Mon, Apr 4, 2011 at 2:40 PM, manigault <[email protected]> wrote:
> Hi all,
> I faced really nasty problem these days. I am executing the following
> code
>
>
>    String destination = "";// this string is initialized before
> coming here
>
>
>    URL url = null;
>    InputStream inputStream = null;
>    try {
>        url = new URL(destination);
>        inputStream = url.openStream();
>        // process the input stream
>    catch (IOException e) {
>        // handle the exception
>    } finally {
>        if (inputStream != null) {
>            inputStream.close();
>        }
>    }
>
>
> This was working fine so far, but i start to receive to following
> exception -
>
>
>    Exception: java.lang.StringIndexOutOfBoundsException
>    Stack Trace :
>    java.lang.String.substring(String.java:1579)
>
> org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getAuthorizationCredentials(HttpURLConnectionImpl.java:
> 1769)
>
> org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.doRequestInternal(HttpURLConnectionImpl.java:
> 1701)
>
> org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.doRequest(HttpURLConnectionImpl.java:
> 1649)
>
> org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:
> 1153)
>    java.net.URL.openStream(URL.java:653)
>
> I can't figure out for which values of 'destination' this exception is
> thrown but i think this should never happen. The doc says the
> openStream could throw only IOException. Any ideas ?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Daniel Drozdzewski

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to