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

reta pushed a commit to branch 4.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/4.1.x-fixes by this push:
     new 905180b7a9 CXF-9197 - Replace new URL(...) in client.vm in wsldto to 
avoid deprecation issues in Java 20+ (#2872)
905180b7a9 is described below

commit 905180b7a90cb5a4e3156b713f38c0ac532fd686
Author: Richard Zowalla <[email protected]>
AuthorDate: Sat Feb 7 02:31:26 2026 +0100

    CXF-9197 - Replace new URL(...) in client.vm in wsldto to avoid deprecation 
issues in Java 20+ (#2872)
    
    (cherry picked from commit 3018434a027fa69572293c388863b092bbe1c4f6)
---
 .../org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
 
b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
index 416ece4513..64b580ea4e 100644
--- 
a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
+++ 
b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
@@ -24,6 +24,8 @@ package $intf.PackageName;
 
 import java.io.File;
 import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URL;
 #if ($markGenerated == "true")
 import jakarta.annotation.Generated;
@@ -71,8 +73,10 @@ public final class ${clientClassName} {
                 if (wsdlFile.exists()) {
                     wsdlURL = wsdlFile.toURI().toURL();
                 } else {
-                    wsdlURL = new URL(args[0]);
+                    wsdlURL = new URI(args[0]).toURL();
                 }
+            } catch (URISyntaxException e) {
+                e.printStackTrace();
             } catch (MalformedURLException e) {
                 e.printStackTrace();
             }

Reply via email to