diff options
author | rbuj <robert.buj@gmail.com> | 2014-07-22 21:12:25 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-23 07:56:35 +0000 |
commit | 5d1c5d558a6db7f1a250893f6dfd22c8bc41f481 (patch) | |
tree | 05b46cf2797c49cfcc58af2b31f0f7e1f4b3e9ae | |
parent | 5a51968ca442fe7342b984895a75ef61e47165ce (diff) |
beanshell: [deprecation] toURL() in File has been deprecated
http://docs.oracle.com/javase/6/docs/api/java/io/File.html#toURL()
Change-Id: I7f5ee6ad89ce73fa3b217396669fa42ea6e75c8a
Reviewed-on: https://gerrit.libreoffice.org/10473
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | external/beanshell/bsh-2.0b1-src.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/external/beanshell/bsh-2.0b1-src.patch b/external/beanshell/bsh-2.0b1-src.patch index a1358d391168..a67e3ee2e491 100644 --- a/external/beanshell/bsh-2.0b1-src.patch +++ b/external/beanshell/bsh-2.0b1-src.patch @@ -42,3 +42,44 @@ import java.util.ArrayList; import java.util.List; +--- misc/BeanShell/src/bsh/classpath/BshClassPath.java 2003-12-19 17:14:28.000000000 +0100 ++++ misc/build/BeanShell/src/bsh/classpath/BshClassPath.java 2014-07-22 21:02:52.000000000 +0200 +@@ -42,6 +42,7 @@ + import bsh.StringUtil; + import bsh.ClassPathException; + import java.lang.ref.WeakReference; ++import java.lang.SecurityException; + import bsh.NameSource; + + /** +@@ -569,7 +570,7 @@ + // Java deals with relative paths for it's bootstrap loader + // but JARClassLoader doesn't. + urls[i] = new File( +- new File(paths[i]).getCanonicalPath() ).toURL(); ++ new File(paths[i]).getCanonicalPath() ).toURI().toURL(); + } catch ( IOException e ) { + throw new ClassPathException("can't parse class path: "+e); + } +@@ -641,9 +642,11 @@ + { + //String rtjar = System.getProperty("java.home")+"/lib/rt.jar"; + String rtjar = getRTJarPath(); +- URL url = new File( rtjar ).toURL(); ++ URL url = new File( rtjar ).toURI().toURL(); + bootClassPath = new BshClassPath( + "Boot Class Path", new URL[] { url } ); ++ } catch ( SecurityException e ) { ++ throw new ClassPathException(" can't access to boot jar: "+e); + } catch ( MalformedURLException e ) { + throw new ClassPathException(" can't find boot jar: "+e); + } +@@ -686,7 +689,7 @@ + public static void main( String [] args ) throws Exception { + URL [] urls = new URL [ args.length ]; + for(int i=0; i< args.length; i++) +- urls[i] = new File(args[i]).toURL(); ++ urls[i] = new File(args[i]).toURI().toURL(); + BshClassPath bcp = new BshClassPath( "Test", urls ); + } + |