Fix whitespaces
Credit to @breakponchito
See https://github.com/payara/Payara/issues/4551
The following block of code process the arguments to prepare the execution of the broker:
the following block:
if (brokerExtraArgs != null && !("".equals(brokerExtraArgs))) {
StringTokenizer st = new StringTokenizer(brokerExtraArgs, " ");
while (st.hasMoreTokens()) {
String t = st.nextToken();
v.add(t);
}
}
process the brokerArgs and separates considering the delimiter as a white space, that is why when sending the following attribute:
brokerArgs= -jrehome "C:\Program Files\Java\jdk-11.0.12" is processed as follows:
-jrehome "C:\Program Files\Java\jdk-11.0.12" this is saved on a Vector that is processed after
then the following block of code validates the sequence of parameters. The expected case is waiting the path after the property -jrehome but after the previous separation we have two values after the property:
that is why the following exception is thrown because the third position is not expected
[2021-10-20T17:49:14.044-0500] [Payara 5.2021.9-SNAPSHOT] [SEVERE] [] [] [tid: _ThreadID=150 _ThreadName=JMS_PROXY_default_JMS_host-kernel(1) SelectorRunner] [timeMillis: 1634770154044] [levelValue: 1000] [[ java.lang.IllegalArgumentException: unknown option Files\Java\jdk-11.0.12"