You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ma...@apache.org on 2019/08/17 18:59:35 UTC

[netbeans] branch master updated: [NETBEANS-2721] - remove remaining toURL() deprecations

This is an automated email from the ASF dual-hosted git repository.

matthiasblaesing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 3498ed8  [NETBEANS-2721] - remove remaining toURL() deprecations
3498ed8 is described below

commit 3498ed8164c3d82c390dd4dad477630b43c2b827
Author: Brad Walker <bw...@musings.com>
AuthorDate: Tue Jun 18 09:53:19 2019 -0600

    [NETBEANS-2721] - remove remaining toURL() deprecations
    
    Remove the remaining File.toURL() deprecations.
---
 .../org/netbeans/modules/websvc/manager/codegen/Wsdl2Java.java    | 2 +-
 .../src/org/netbeans/modules/html/editor/javadoc/HelpManager.java | 2 +-
 .../src/org/netbeans/modules/palette/ui/TextImporterUI.java       | 6 +++---
 .../src/org/netbeans/modules/xml/catalog/CatalogEntryPanel.java   | 2 +-
 .../modules/xml/retriever/catalog/impl/CatalogModelImpl.java      | 4 ++--
 .../org/netbeans/modules/xsl/transform/TransformPerformer.java    | 2 +-
 .../src/org/netbeans/modules/form/editors/CustomIconEditor.java   | 8 ++++----
 .../netbeans/modules/j2ee/persistence/util/CustomClassLoader.java | 2 +-
 8 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/enterprise/websvc.manager/src/org/netbeans/modules/websvc/manager/codegen/Wsdl2Java.java b/enterprise/websvc.manager/src/org/netbeans/modules/websvc/manager/codegen/Wsdl2Java.java
index 7c86455..10ac3f5 100644
--- a/enterprise/websvc.manager/src/org/netbeans/modules/websvc/manager/codegen/Wsdl2Java.java
+++ b/enterprise/websvc.manager/src/org/netbeans/modules/websvc/manager/codegen/Wsdl2Java.java
@@ -208,7 +208,7 @@ public class Wsdl2Java {
     
     private boolean createJaxRpcProxyJars(Properties properties) {
         try {
-            String wsdlUrlName = new File(webServiceData.getURL()).toURI().toURL().toString();
+            String wsdlUrlName = new File(webServiceData.getWsdlFile()).toURI().toURL().toString();
             createJaxrpcConfigFile(wsdlUrlName, properties);
             
             ExecutorTask executorTask = ActionUtils.runTarget(FileUtil.toFileObject(getAntScript()),
diff --git a/ide/html.editor/src/org/netbeans/modules/html/editor/javadoc/HelpManager.java b/ide/html.editor/src/org/netbeans/modules/html/editor/javadoc/HelpManager.java
index dc16064..3220200 100644
--- a/ide/html.editor/src/org/netbeans/modules/html/editor/javadoc/HelpManager.java
+++ b/ide/html.editor/src/org/netbeans/modules/html/editor/javadoc/HelpManager.java
@@ -109,7 +109,7 @@ public class HelpManager {
                 File f = InstalledFileLocator.getDefault().locate(help, null, false); //NoI18N
                 if (f != null){
                     try {
-                        URL urll = f.toURL();
+                        URL urll = f.toURI().toURL();
                         urll = FileUtil.getArchiveRoot(urll);
                         helpZipURL = new URI(urll.getProtocol(), urll.getFile(), urll.getRef()).toString();
                     } catch (java.net.MalformedURLException e){
diff --git a/ide/spi.palette/src/org/netbeans/modules/palette/ui/TextImporterUI.java b/ide/spi.palette/src/org/netbeans/modules/palette/ui/TextImporterUI.java
index 2ed47da..fb9af24 100644
--- a/ide/spi.palette/src/org/netbeans/modules/palette/ui/TextImporterUI.java
+++ b/ide/spi.palette/src/org/netbeans/modules/palette/ui/TextImporterUI.java
@@ -254,7 +254,7 @@ private void btnSelectLargeIconActionPerformed(java.awt.event.ActionEvent evt) {
         if( null != icon ) {
             lblLargeIcon.setIcon(icon);
             try {
-                largeIconPath = iconFile.toURL().toExternalForm();
+                largeIconPath = iconFile.toURI().toURL().toExternalForm();
             } catch (MalformedURLException ex) {
                 //TODO log error
             }
@@ -269,7 +269,7 @@ private void btnSelectSmallIconActionPerformed(java.awt.event.ActionEvent evt) {
         if( null != icon ) {
             lblSmallIcon.setIcon(icon);
             try {
-                smallIconPath = iconFile.toURL().toExternalForm();
+                smallIconPath = iconFile.toURI().toURL().toExternalForm();
             } catch (MalformedURLException ex) {
                 //TODO log error
             }
@@ -308,7 +308,7 @@ private void btnSelectSmallIconActionPerformed(java.awt.event.ActionEvent evt) {
     
     private Icon readIconFromFile( File iconFile ) {
         try {
-            Image img = ImageIO.read( iconFile.toURL() );
+            Image img = ImageIO.read( iconFile.toURI().toURL() );
             if( null != img ) {
                 ImageIcon res = new ImageIcon( img );
                 if( res.getIconWidth() > 32 || res.getIconHeight() > 32 )  {
diff --git a/ide/xml.catalog.ui/src/org/netbeans/modules/xml/catalog/CatalogEntryPanel.java b/ide/xml.catalog.ui/src/org/netbeans/modules/xml/catalog/CatalogEntryPanel.java
index cef640d..d609cb9 100644
--- a/ide/xml.catalog.ui/src/org/netbeans/modules/xml/catalog/CatalogEntryPanel.java
+++ b/ide/xml.catalog.ui/src/org/netbeans/modules/xml/catalog/CatalogEntryPanel.java
@@ -232,7 +232,7 @@ public class CatalogEntryPanel extends javax.swing.JPanel {
         java.io.File f = org.netbeans.modules.xml.catalog.lib.Util.selectFile("dtd xsd DTD XSD", dialogTitle, maskTitle); // NOI18N
         if (f == null) return;
         try {
-            String location = f.toURL().toExternalForm();
+            String location = f.toURI().toURL().toExternalForm();
             uriTF.setText(location);
         } catch (java.net.MalformedURLException ex) {
             // ignore
diff --git a/ide/xml.retriever/src/org/netbeans/modules/xml/retriever/catalog/impl/CatalogModelImpl.java b/ide/xml.retriever/src/org/netbeans/modules/xml/retriever/catalog/impl/CatalogModelImpl.java
index f400a5e..a0e22b9 100644
--- a/ide/xml.retriever/src/org/netbeans/modules/xml/retriever/catalog/impl/CatalogModelImpl.java
+++ b/ide/xml.retriever/src/org/netbeans/modules/xml/retriever/catalog/impl/CatalogModelImpl.java
@@ -613,7 +613,7 @@ public class CatalogModelImpl implements CatalogModel {
         catalogResolver = new NbCatalogResolver(manager);
         apacheCatalogResolverObj = catalogResolver.getCatalog();
         for(File catFile : catalogFileList){
-            apacheCatalogResolverObj.parseCatalog(catFile.toURL());
+            apacheCatalogResolverObj.parseCatalog(catFile.toURI().toURL());
         }
         
         String result = null;
@@ -865,4 +865,4 @@ public class CatalogModelImpl implements CatalogModel {
         
         return null;
     }
-}
\ No newline at end of file
+}
diff --git a/ide/xsl/src/org/netbeans/modules/xsl/transform/TransformPerformer.java b/ide/xsl/src/org/netbeans/modules/xsl/transform/TransformPerformer.java
index 6475a3c..7bbdc4c 100644
--- a/ide/xsl/src/org/netbeans/modules/xsl/transform/TransformPerformer.java
+++ b/ide/xsl/src/org/netbeans/modules/xsl/transform/TransformPerformer.java
@@ -535,7 +535,7 @@ public class TransformPerformer {
             File file = FileUtil.toFile(fileObject);
             
             if ( file != null ) {
-                fileURL = file.toURL();
+                fileURL = file.toURI().toURL();
             } else {
                 fileURL = fileObject.getURL();
             }
diff --git a/java/form/src/org/netbeans/modules/form/editors/CustomIconEditor.java b/java/form/src/org/netbeans/modules/form/editors/CustomIconEditor.java
index 7a0743b..8c4f6c3 100644
--- a/java/form/src/org/netbeans/modules/form/editors/CustomIconEditor.java
+++ b/java/form/src/org/netbeans/modules/form/editors/CustomIconEditor.java
@@ -272,7 +272,7 @@ public class CustomIconEditor extends javax.swing.JPanel {
     private void setFromFileName(String fileName) {
         selectedExternalFile = new File(fileName);
         try {
-            urlField.setText(selectedExternalFile.toURL().toExternalForm());
+            urlField.setText(selectedExternalFile.toURI().toURL().toExternalForm());
         }
         catch (MalformedURLException ex) {
             urlField.setText("file:/" + fileName); // NOI18N
@@ -344,7 +344,7 @@ public class CustomIconEditor extends javax.swing.JPanel {
             if (selectedCPFile != null && selectedExternalFile == null && selectedURL == null) {
                 selectedExternalFile = FileUtil.toFile(selectedCPFile);
                 try {
-                    urlField.setText(selectedExternalFile.toURL().toExternalForm());
+                    urlField.setText(selectedExternalFile.toURI().toURL().toExternalForm());
                 }
                 catch (MalformedURLException ex) { // should not happen for existing file
                     ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
@@ -658,7 +658,7 @@ public class CustomIconEditor extends javax.swing.JPanel {
                         selectedURL = null;
                         externalRadio.setSelected(true);
                         try {
-                            urlField.setText(file.toURL().toExternalForm());
+                            urlField.setText(file.toURI().toURL().toExternalForm());
                         } catch (MalformedURLException ex) {
                             ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
                         }
@@ -734,7 +734,7 @@ public class CustomIconEditor extends javax.swing.JPanel {
             File file = fileChooser.getSelectedFile();
             if (file != null) {
                 try {
-                    urlField.setText(file.toURL().toExternalForm());
+                    urlField.setText(file.toURI().toURL().toExternalForm());
                 }
                 catch (MalformedURLException ex) {
                     ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/CustomClassLoader.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/CustomClassLoader.java
index 71364c7..e7f1b07 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/CustomClassLoader.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/CustomClassLoader.java
@@ -177,7 +177,7 @@ public class CustomClassLoader extends URLClassLoader {
                 if (f.exists()) {
                     try {
                         package2File.put(packageName, entry);
-                        return f.toURL();
+                        return f.toURI().toURL();
                     } catch (MalformedURLException ex) {
                         continue;
                     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists