Skip to content

Fixed nullable eventhandlers#15288

Merged
calixtus merged 1 commit into
mainfrom
hotfix-notifications
Mar 7, 2026
Merged

Fixed nullable eventhandlers#15288
calixtus merged 1 commit into
mainfrom
hotfix-notifications

Conversation

@calixtus

@calixtus calixtus commented Mar 7, 2026

Copy link
Copy Markdown
Member

Hotfix for nullable eventhandlers in #14762

grafik

No changelog since introducing PR was merged after last release.

Steps to test

Drag-and-drop a pdf file on JabRef to import citation

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [.] I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • [.] I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • [.] I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • [.] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@calixtus calixtus added the dev: hotfix High-level fix for a bug, may need root-cause investigation in future. label Mar 7, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix nullable event handlers in task notifications

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Fixed NullPointerException when task event handlers are null
• Changed Optional.of() to Optional.ofNullable() for three event handlers
• Prevents crashes during PDF drag-and-drop import operations
Diagram
flowchart LR
  A["Task Event Handlers<br/>onSucceeded, onFailed, onCancelled"] -->|"Optional.of()<br/>throws NPE if null"| B["NullPointerException"]
  A -->|"Optional.ofNullable()<br/>handles null safely"| C["Proper Handler Execution"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/Notifications.java 🐞 Bug fix +3/-3

Replace Optional.of with ofNullable for event handlers

• Replaced Optional.of() with Optional.ofNullable() for three event handlers
• Handles onSucceeded, onFailed, and onCancelled event handlers safely
• Prevents NullPointerException when task handlers are not defined
• Maintains existing handler behavior through conditional execution

jabgui/src/main/java/org/jabref/gui/Notifications.java


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@calixtus calixtus enabled auto-merge March 7, 2026 06:45
@calixtus calixtus added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 7, 2026
@calixtus calixtus added this pull request to the merge queue Mar 7, 2026
@testlens-app

testlens-app Bot commented Mar 7, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: c3007a9
▶️ Tests: 10126 executed
⚪️ Checks: 81/81 completed


Learn more about TestLens at testlens.app.

@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Mar 7, 2026
Merged via the queue into main with commit 68da19c Mar 7, 2026
71 of 82 checks passed
@calixtus calixtus deleted the hotfix-notifications branch March 7, 2026 07:24
@ThiloteE ThiloteE mentioned this pull request Mar 7, 2026
5 tasks
Siedlerchr added a commit to statxc/jabref that referenced this pull request Mar 10, 2026
* upstream/main: (59 commits)
  Fix 15000 identifier (JabRef#15286)
  Chore(deps): Bump dev.langchain4j:langchain4j-bom in /versions (JabRef#15305)
  Supress JavaFX VirtualFlow Info log noise for large libraries (10k+). (JabRef#15298)
  Chore(deps): Bump commons-logging:commons-logging in /versions (JabRef#15304)
  Fix merge dialog closing immediately when only one PDF importer returns metadata (JabRef#15127) (JabRef#15287)
  Fixed nullable eventhandlers (JabRef#15288)
  New Crowdin updates (JabRef#15285)
  Fix the ESC key for GlobalSearchResultDialog (JabRef#15259)
  Remove jbang plugin banner (JabRef#15282)
  Chore(deps): Bump org.apache.httpcomponents.core5:httpcore5 in /versions (JabRef#15281)
  Udpate to latest gradle master (JabRef#15279)
  Migrate to GemsFX Notifications (JabRef#14762)
  Chore(deps): Bump JetBrains/junie-github-action from 0 to 1 (JabRef#15272)
  Chore(deps): Bump docker/setup-qemu-action from 3 to 4 (JabRef#15269)
  Feature/citation count dropdown (JabRef#15216)
  Update dependency org.apache.maven.plugins:maven-resources-plugin to v3.5.0 (JabRef#15275)
  Chore(deps): Bump jablib/src/main/resources/csl-styles (JabRef#15273)
  Fix more security
  Fix pr_body leakage
  Chore: add dependency-management.md (JabRef#15278)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: hotfix High-level fix for a bug, may need root-cause investigation in future. status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants