Hello,

The java.io.File.toURL() method is now deprecated (http://download.oracle.com/javase/6/docs/api/java/io/File.html#toURL%28%29). The java compiler generates that kind of warnings :

warning: [deprecation] toURL() in java.io.File has been deprecated
ConverterInfoReader cirPlugin = new ConverterInfoReader(pluginJar.toURL().toString(), false);


The attached patch replaces a call to File.toURL() by a call to File.toURI() followed by a call to URI.toURL() in ActiveSyncDriver.java.

Feel free to apply whatever free software licence you want to the crazy piece of code that comes as an attachment.

Best Regards,
Cyril Roelandt.
>From 29ca4913fac8cf93ae8e08e1690fb3602fdbd61d Mon Sep 17 00:00:00 2001
From: Cyril Roelandt <tipec...@gmail.com>
Date: Thu, 28 Apr 2011 01:02:51 +0200
Subject: [PATCH] Removing the deprecated java.io.File.toURL() method.

java.io.File.toURL() has been replaced by java.io.File.toURI().toURL().
---
 .../openoffice/xmerge/util/ActiveSyncDriver.java   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/ActiveSyncDriver.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/ActiveSyncDriver.java
index 21c6b64..2b922da 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/ActiveSyncDriver.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/ActiveSyncDriver.java
@@ -100,7 +100,7 @@ public class ActiveSyncDriver {
             pluginJar = new File(ooClassDir + "pexcel.jar");
         }
                
-        ConverterInfoReader cirPlugin = new ConverterInfoReader(pluginJar.toURL().toString(), false);     
+        ConverterInfoReader cirPlugin = new ConverterInfoReader(pluginJar.toURI().toURL().toString(), false);
         
         ConverterInfoMgr.addPlugIn(cirPlugin.getConverterInfoEnumeration());
         
-- 
1.7.3.4

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to