-
Notifications
You must be signed in to change notification settings - Fork 306
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
GlassFishProperties throws NPE if the Properties is null. #4657
Comments
Hi Andrew, Do you want to a submit a PR for this improvement? You can find the CLA here : https://github.com/payara/Payara/blob/master/PayaraCLA.pdf. Regards |
Yes sure. But let's discuss how a fix should handle this case. (1) Describe in the documentation that properties should not be null (2) Or, check for properties being null and produce a warning or throw an NPE What do you think? |
Hi Andrew, I would check the parameter and throw a IllegalArgumentException (or NullPointerException) and document it in the JavaDoc. |
Hi , I update it . Please let me know the feedback . Thanks, |
Thanks @bhanuunrivalled ! This looks good to me. |
Thank you @andrewhabib . I had the similar issue :) |
* #4657 GlassFishProperties throws NPE if the Properties is null * cleanup of NPE handling * fixes suggested by @dmatej Co-authored-by: Bhanu Akula <[email protected]>
Description
The properties class org.glassfish.embeddable.GlassFishProperties could silently be corrupt if initialized with a null Properties object.
Steps to reproduce (Only for bug reports)
The following instantiation would not produce any warning...
However, when you try to use any of the GlassFishProperties, you'd get NullPointerException.
E.g.:
Therefore, constructors of GlassFishProperties should check for a null Properties object
or at least document the above behavior in the documentation.
The text was updated successfully, but these errors were encountered: