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

fix: prevent NPE when creating init parameters #19856

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

mcollovati
Copy link
Collaborator

Description

ServletConfig might contain init parameter with null values. This is however not supported by java Properties class.
This change adds a null check and logs offending keys for debugging purpose.

Fixes #19855

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

ServletConfig might contain init parameter with null values. This is however not
supported by java Properties class.
This change adds a null check and logs offending keys for debugging purpose.

Fixes #19855
Copy link

sonarcloud bot commented Sep 2, 2024

Copy link

github-actions bot commented Sep 2, 2024

Test Results

1 135 files  ± 0  1 135 suites  ±0   1h 30m 42s ⏱️ +29s
7 382 tests + 1  7 332 ✅ + 1  50 💤 ±0  0 ❌ ±0 
7 738 runs  +46  7 678 ✅ +46  60 💤 ±0  0 ❌ ±0 

Results for commit ab70540. ± Comparison against base commit 9ee97e8.

♻️ This comment has been updated with latest results.

@caalador caalador merged commit d97beba into main Sep 2, 2024
25 of 26 checks passed
@caalador caalador deleted the issues/19855_deploymentconfigurationfactory_npe branch September 2, 2024 09:43
vaadin-bot pushed a commit that referenced this pull request Sep 2, 2024
ServletConfig might contain init parameter with null values. This is however not
supported by java Properties class.
This change adds a null check and logs offending keys for debugging purpose.

Fixes #19855
@vaadin-bot
Copy link
Collaborator

Hi @mcollovati and @caalador, when i performed cherry-pick to this commit to 23.5, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick d97beba
error: could not apply d97beba... fix: prevent NPE when creating init parameters (#19856)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

vaadin-bot pushed a commit that referenced this pull request Sep 2, 2024
ServletConfig might contain init parameter with null values. This is however not
supported by java Properties class.
This change adds a null check and logs offending keys for debugging purpose.

Fixes #19855
vaadin-bot added a commit that referenced this pull request Sep 2, 2024
ServletConfig might contain init parameter with null values. This is however not
supported by java Properties class.
This change adds a null check and logs offending keys for debugging purpose.

Fixes #19855

Co-authored-by: Marco Collovati <marco@vaadin.com>
mcollovati added a commit that referenced this pull request Sep 2, 2024
ServletConfig might contain init parameter with null values. This is however not
supported by java Properties class.
This change adds a null check and logs offending keys for debugging purpose.

Fixes #19855
vaadin-bot added a commit that referenced this pull request Sep 3, 2024
…19858)

* fix: prevent NPE when creating init parameters (#19856)

ServletConfig might contain init parameter with null values. This is however not
supported by java Properties class.
This change adds a null check and logs offending keys for debugging purpose.

Fixes #19855

* WIP: test if devtools dependency fix the build

* Revert "WIP: test if devtools dependency fix the build"

This reverts commit 836bb4b.

---------

Co-authored-by: Marco Collovati <marco@vaadin.com>
mcollovati added a commit that referenced this pull request Sep 3, 2024
…19859)

ServletConfig might contain init parameter with null values. This is however not
supported by java Properties class.
This change adds a null check and logs offending keys for debugging purpose.

Fixes #19855
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha15 and is also targeting the upcoming stable 24.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential NullPointerException in DeploymentConfigurationFactory.createInitParameters
3 participants