Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use j2se variable and collapse on split #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

klarose
Copy link

@klarose klarose commented Aug 17, 2022

The getJVMArgs() function has two problems:

  • It uses the J2SE pointer directly, rather than its abstraction,
    leading to null pointer accesses.
  • It splits on " " without collapsing consecutive occurances of the
    token, leading to invalid arguments being passed to the JVM (e.g. the
    main class is passed in as an empty string) when the xml has
    whitespace in the java-vm-args attribute.

Fix these two problems by using the proper variable for accessing the
JavaVMArgs, and split them in a fashion that skips consecutive
whitespace.

In a similar vein, also strip whitespace in the args prior to doing this
work so that an entirely empty attribute does not lead to us
unnecessarily adding arguments.

The getJVMArgs() function has two problems:
 - It uses the J2SE pointer directly, rather than its abstraction,
   leading to null pointer accesses.
 - It splits on " " without collapsing consecutive occurances of the
   token, leading to invalid arguments being passed to the JVM (e.g. the
   main class is passed in as an empty string) when the xml has
   whitespace in the java-vm-args attribute.

Fix these two problems by using the proper variable for accessing the
JavaVMArgs, and split them in a fashion that skips consecutive
whitespace.

In a similar vein, also strip whitespace in the args prior to doing this
work so that an entirely empty attribute does not lead to us
unnecessarily adding arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant