Skip to content

fix: Use service already assigned - #12808

Merged
Artur- merged 2 commits into
masterfrom
use_service
Jan 25, 2022
Merged

Artur- merged 2 commits into
masterfrom
use_service

Conversation

@TatuLund

@TatuLund TatuLund commented Jan 24, 2022 •

Copy link
Copy Markdown
Contributor

Code cleanup

fixes: #12807

Note, exception is thrown here: https://github.com/vaadin/flow/blob/2.8/flow-server/src/main/java/com/vaadin/flow/server/communication/UidlWriter.java#L178

But earlier session.getService() did not throw https://github.com/vaadin/flow/blob/2.8/flow-server/src/main/java/com/vaadin/flow/server/communication/UidlWriter.java#L157

Hence I assume using stored service reference will make code less prone to throw

@github-actions

github-actions Bot commented Jan 24, 2022 •

Copy link
Copy Markdown
Contributor

Unit Test Results

   770 files  ±0     770 suites  ±0   26m 10s ⏱️ + 2m 7s
5 745 tests ±0  5 694 ✔️  - 1  51 💤 +1  0 ❌ ±0 
5 773 runs  +7  5 724 ✔️ +6  49 💤 +1  0 ❌ ±0 

Results for commit a140239. ± Comparison against base commit 3131a72.

♻️ This comment has been updated with latest results.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@caalador
caalador self-requested a review January 24, 2022 12:04

@Artur- Artur- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing wrong with this change but if this fixes some issue, something else might be wrong

@Artur-
Artur- merged commit 4155088 into master Jan 25, 2022
@Artur-
Artur- deleted the use_service branch January 25, 2022 12:25
vaadin-bot pushed a commit that referenced this pull request Jan 25, 2022
vaadin-bot pushed a commit that referenced this pull request Jan 25, 2022
vaadin-bot added a commit that referenced this pull request Jan 25, 2022
Code cleanup

Fixes #12807

Co-authored-by: Tatu Lund <tatu@vaadin.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with platform 23.0.0.alpha4 and is also targeting the upcoming stable 23.0.0 version.

joheriks pushed a commit that referenced this pull request Jan 31, 2022
Code cleanup

Fixes #12807

Co-authored-by: Tatu Lund <tatu@vaadin.com>
joheriks pushed a commit that referenced this pull request Feb 3, 2022
Code cleanup

Fixes #12807

Co-authored-by: Tatu Lund <tatu@vaadin.com>
caalador pushed a commit that referenced this pull request Feb 4, 2022
Code cleanup

Fixes #12807

Co-authored-by: Tatu Lund <tatu@vaadin.com>

Co-authored-by: Vaadin Bot <vaadin-bot@users.noreply.github.com>
Co-authored-by: Tatu Lund <tatu@vaadin.com>
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.

Cannot invoke "com.vaadin.flow.server.VaadinSession.getService()" because the return value of "com.vaadin.flow.component.UI.getSession()" is null

4 participants