From 6db95a876e708f056ffaf4f09ba969861bb472a2 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 27 Sep 2024 06:36:41 +0200 Subject: [PATCH 1/3] FISH-9803 - index in array updated to prevent null value as input parameter. --- .../webservices/monitoring/WebServiceTesterServlet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java b/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java index cac6bf88919..2556152c5bb 100644 --- a/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java +++ b/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java @@ -549,10 +549,10 @@ private String wsImport(URL wsdlLocation) throws IOException { wsimportArgs[7] = "-extension"; String modulesDir = System.getProperty("com.sun.aas.installRoot") + File.separator + "modules" + File.separator; wsimportArgs[8] = modulesDir + "jakarta.jws-api.jar"; - wsimportArgs[10] = modulesDir + "webservices-osgi.jar"; - wsimportArgs[11] = modulesDir + "jaxb-osgi.jar"; - wsimportArgs[12] = modulesDir + "jakarta.xml.ws-api.jar"; - wsimportArgs[13] = modulesDir + "jakarta.activation-api.jar"; + wsimportArgs[9] = modulesDir + "webservices-osgi.jar"; + wsimportArgs[10] = modulesDir + "jaxb-osgi.jar"; + wsimportArgs[11] = modulesDir + "jakarta.xml.ws-api.jar"; + wsimportArgs[12] = modulesDir + "jakarta.activation-api.jar"; WSToolsObjectFactory tools = WSToolsObjectFactory.newInstance(); logger.log(Level.INFO, LogUtils.WSIMPORT_INVOKE, wsdlLocation); boolean success = tools.wsimport(System.out, wsimportArgs); From 4b144474679847f1ecad60820620286b1e2a38cc Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 27 Sep 2024 09:18:53 +0200 Subject: [PATCH 2/3] FISH-9803 - argument array resized to current size --- .../webservices/monitoring/WebServiceTesterServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java b/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java index 2556152c5bb..7ef08b42387 100644 --- a/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java +++ b/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java @@ -538,7 +538,7 @@ private String wsImport(URL wsdlLocation) throws IOException { logger.log(Level.SEVERE, LogUtils.CREATE_DIR_FAILED, classesDir); } - String[] wsimportArgs = new String[14]; + String[] wsimportArgs = new String[13]; wsimportArgs[0] = "-d"; wsimportArgs[1] = classesDir.getAbsolutePath(); wsimportArgs[2] = "-keep"; From 5082669f388346c9cc76b6987c631d3102fe9090 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 27 Sep 2024 10:31:25 +0200 Subject: [PATCH 3/3] FISH-9803 - argument array changed to list. --- .../monitoring/WebServiceTesterServlet.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java b/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java index 7ef08b42387..e24aa0e9d8c 100644 --- a/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java +++ b/appserver/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/monitoring/WebServiceTesterServlet.java @@ -538,24 +538,24 @@ private String wsImport(URL wsdlLocation) throws IOException { logger.log(Level.SEVERE, LogUtils.CREATE_DIR_FAILED, classesDir); } - String[] wsimportArgs = new String[13]; - wsimportArgs[0] = "-d"; - wsimportArgs[1] = classesDir.getAbsolutePath(); - wsimportArgs[2] = "-keep"; - wsimportArgs[3] = wsdlLocation.toExternalForm(); - wsimportArgs[4] = "-Xendorsed"; - wsimportArgs[5] = "-target"; - wsimportArgs[6] = "2.1"; - wsimportArgs[7] = "-extension"; + List wsimportArgs = new ArrayList<>(13); + wsimportArgs.add("-d"); + wsimportArgs.add(classesDir.getAbsolutePath()); + wsimportArgs.add("-keep"); + wsimportArgs.add(wsdlLocation.toExternalForm()); + wsimportArgs.add("-Xendorsed"); + wsimportArgs.add("-target"); + wsimportArgs.add("2.1"); + wsimportArgs.add("-extension"); String modulesDir = System.getProperty("com.sun.aas.installRoot") + File.separator + "modules" + File.separator; - wsimportArgs[8] = modulesDir + "jakarta.jws-api.jar"; - wsimportArgs[9] = modulesDir + "webservices-osgi.jar"; - wsimportArgs[10] = modulesDir + "jaxb-osgi.jar"; - wsimportArgs[11] = modulesDir + "jakarta.xml.ws-api.jar"; - wsimportArgs[12] = modulesDir + "jakarta.activation-api.jar"; + wsimportArgs.add(modulesDir + "jakarta.jws-api.jar"); + wsimportArgs.add(modulesDir + "webservices-osgi.jar"); + wsimportArgs.add(modulesDir + "jaxb-osgi.jar"); + wsimportArgs.add(modulesDir + "jakarta.xml.ws-api.jar"); + wsimportArgs.add(modulesDir + "jakarta.activation-api.jar"); WSToolsObjectFactory tools = WSToolsObjectFactory.newInstance(); logger.log(Level.INFO, LogUtils.WSIMPORT_INVOKE, wsdlLocation); - boolean success = tools.wsimport(System.out, wsimportArgs); + boolean success = tools.wsimport(System.out, wsimportArgs.toArray(new String[]{})); if (success) { logger.log(Level.INFO, LogUtils.WSIMPORT_OK);