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: Get boolean only if eventData has the key #13021

Merged
merged 3 commits into from
Feb 16, 2022
Merged

fix: Get boolean only if eventData has the key #13021

merged 3 commits into from
Feb 16, 2022

Conversation

TatuLund
Copy link
Contributor

Fixes: #12198

@github-actions
Copy link

github-actions bot commented Feb 14, 2022

Unit Test Results

   936 files  +  1     936 suites  +1   36m 23s ⏱️ -17s
6 098 tests +  6  6 048 ✔️ +  7  50 💤 ±0  0 ±0 
6 291 runs  +14  6 235 ✔️ +12  56 💤 +3  0 ±0 

Results for commit 20113e8. ± Comparison against base commit d650205.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@mcollovati mcollovati left a comment

Choose a reason for hiding this comment

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

Does it make sense to add a test in ElementListenersTest for this change? Something like

AtomicInteger eventCount = new AtomicInteger();
DomListenerRegistration registration = ns.add("foo", e -> eventCount.incrementAndGet());
registration.setFilter("filterKey");

ns.fireEvent(createEvent("foo"));
Assert.assertEquals(0, eventCount.get());

JsonObject eventData = Json.createObject();
eventData.put("filterKey", true);
ns.fireEvent(new DomEvent(new Element("element"), "foo", eventData));
Assert.assertEquals(1, eventCount.get());

@sonarqubecloud
Copy link

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 105 Code Smells

No Coverage information No Coverage information
0.2% 0.2% Duplication

@vaadin-bot vaadin-bot added +1.0.0 and removed +0.0.1 labels Feb 15, 2022
@mcollovati mcollovati merged commit 992b236 into master Feb 16, 2022
@mcollovati mcollovati deleted the fix12198 branch February 16, 2022 08:41
vaadin-bot pushed a commit that referenced this pull request Feb 21, 2022
* Get boolean only if eventData has the key

* Formatting

* Add unit test
vaadin-bot pushed a commit that referenced this pull request Feb 21, 2022
* Get boolean only if eventData has the key

* Formatting

* Add unit test
vaadin-bot pushed a commit that referenced this pull request Feb 21, 2022
* Get boolean only if eventData has the key

* Formatting

* Add unit test
@vaadin-bot
Copy link
Collaborator

Hi @TatuLund and @mcollovati, when i performed cherry-pick to this commit to 2.7, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 992b236
error: could not apply 992b236... fix: Get boolean only if eventData has the key (#13021)
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add ' or 'git rm '
hint: and commit the result with 'git commit'

vaadin-bot added a commit that referenced this pull request Feb 21, 2022
* Get boolean only if eventData has the key

* Formatting

* Add unit test

Co-authored-by: Tatu Lund <[email protected]>
vaadin-bot added a commit that referenced this pull request Feb 21, 2022
* Get boolean only if eventData has the key

* Formatting

* Add unit test

Co-authored-by: Tatu Lund <[email protected]>
vaadin-bot added a commit that referenced this pull request Feb 21, 2022
* Get boolean only if eventData has the key

* Formatting

* Add unit test

Co-authored-by: Tatu Lund <[email protected]>
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.

Nullpointer related to Shortcuts
4 participants