Kaydet (Commit) f93ce4f7 authored tarafından rbuj's avatar rbuj Kaydeden (comit) Noel Grandin

scripting: decode(String) in URLDecoder has been deprecated

http://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLDecoder.html#decode(java.lang.String)

Change-Id: I71ecb498c93d5e8d6959bdc3ab263a5ff48c1c21
Reviewed-on: https://gerrit.libreoffice.org/11453Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 0b3b907e
...@@ -174,12 +174,21 @@ public class ParcelContainer implements XNameAccess ...@@ -174,12 +174,21 @@ public class ParcelContainer implements XNameAccess
// TODO handler package ParcelContainer? // TODO handler package ParcelContainer?
if ( !containerUrl.startsWith( "vnd.sun.star.tdoc:" ) ) if ( !containerUrl.startsWith( "vnd.sun.star.tdoc:" ) )
{ {
// return name try
String decodedUrl = java.net.URLDecoder.decode( containerUrl );
int indexOfSlash = decodedUrl.lastIndexOf('/');
if ( indexOfSlash != -1 )
{ {
name = decodedUrl.substring( indexOfSlash + 1 ); // return name
String decodedUrl = java.net.URLDecoder.decode( containerUrl, "UTF-8" );
int indexOfSlash = decodedUrl.lastIndexOf('/');
if ( indexOfSlash != -1 )
{
name = decodedUrl.substring( indexOfSlash + 1 );
}
}
catch (UnsupportedEncodingException e)
{
com.sun.star.uno.RuntimeException e2 = new com.sun.star.uno.RuntimeException();
e2.initCause(e);
throw e2;
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment