Skip to content

Conversation

@DropSnorz
Copy link
Owner

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Dec 29, 2025

Walkthrough

This PR reorganizes JavaFX initialization threading, defers account loading to post-initialization in the main controller, replaces null-based specification placeholders with explicit unrestricted specifications, and updates test mocking from MockBean to MockitoBean annotation.

Changes

Cohort / File(s) Summary
JavaFX Threading & Initialization
owlplug-client/src/main/java/com/owlplug/OwlPlug.java
Added Platform.runLater(...) wrapper for post-initialization controller setup; consolidated boot method to dispatch initialization on JavaFX Application Thread.
Controller Initialization Sequencing
owlplug-client/src/main/java/com/owlplug/core/controllers/MainController.java
Moved refreshAccounts() call from initialize() to dispatchPostInitialize(), changing the timing of when account list is populated relative to crash recovery evaluation.
Specification Improvements
owlplug-client/src/main/java/com/owlplug/explore/model/search/ExploreCriteriaAdapter.java
Replaced two instances of Specification.where(null) with Specification.unrestricted() for explicit, clearer specification initialization.
Test Mock Injection Updates
owlplug-client/src/test/java/com/owlplug/AppTestContext.java
Updated test Preferences mock from @MockBean to @MockitoBean annotation and corresponding import from org.springframework.boot.test.mock.mockito.MockBean to org.springframework.test.context.bean.override.mockito.MockitoBean.

Sequence Diagram

sequenceDiagram
    participant Main as Application Entry
    participant OwlPlug as OwlPlug.boot()
    participant Platform as JavaFX Platform
    participant MainCtrl as MainController
    participant Accounts as AccountComboBox
    participant Recovery as Crash Recovery

    Main->>OwlPlug: boot(String[] args)
    OwlPlug->>OwlPlug: Initialize JavaFX Preloader
    OwlPlug->>MainCtrl: initialize() [JavaFX init phase]
    MainCtrl->>MainCtrl: Setup UI Components
    OwlPlug->>Platform: runLater() [post-initialization]
    Platform->>MainCtrl: dispatchPostInitialize()
    MainCtrl->>Accounts: refreshAccounts()
    Accounts-->>MainCtrl: Accounts Loaded
    MainCtrl->>Recovery: Evaluate Crash Recovery
    Recovery-->>MainCtrl: Recovery Dialog (if needed)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning No description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a pull request description explaining the motivation, impact, and any testing performed for the Java and JavaFX version 25 upgrade.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Update java and javafx to v25' accurately reflects the main objective of the PR, which is to upgrade Java and JavaFX dependencies to version 25.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7596dcb and 5b57756.

⛔ Files ignored due to path filters (4)
  • .github/workflows/dev.yml is excluded by !**/*.yml
  • .github/workflows/main.yml is excluded by !**/*.yml
  • owlplug-client/pom.xml is excluded by !**/*.xml
  • pom.xml is excluded by !**/*.xml
📒 Files selected for processing (4)
  • owlplug-client/src/main/java/com/owlplug/OwlPlug.java
  • owlplug-client/src/main/java/com/owlplug/core/controllers/MainController.java
  • owlplug-client/src/main/java/com/owlplug/explore/model/search/ExploreCriteriaAdapter.java
  • owlplug-client/src/test/java/com/owlplug/AppTestContext.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-jar
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (7)
owlplug-client/src/main/java/com/owlplug/explore/model/search/ExploreCriteriaAdapter.java (2)

66-66: LGTM: Consistent use of Specification.unrestricted().

The fallback case now consistently uses Specification.unrestricted(), matching the initialization at line 31. This improves readability and explicitly communicates intent.


31-31: Good improvement to use Specification.unrestricted() for clarity.

The change from Specification.where(null) to Specification.unrestricted() improves code readability by using the more explicit and idiomatic API. The method is available in Spring Data JPA 4.0.1 and is semantically equivalent to the previous approach.

owlplug-client/src/main/java/com/owlplug/core/controllers/MainController.java (1)

180-181: LGTM: Proper JavaFX threading for account refresh.

Moving refreshAccounts() to dispatchPostInitialize() ensures account loading occurs on the JavaFX Application Thread (since this method is now wrapped in Platform.runLater() per the changes in OwlPlug.java). This improves thread safety when populating the accountComboBox.

The timing is appropriate—accounts are refreshed before the crash recovery dialog check, maintaining the correct initialization sequence.

owlplug-client/src/main/java/com/owlplug/OwlPlug.java (3)

66-76: LGTM: Clean JavaFX bootstrap with preloader.

The new boot() method properly consolidates the JavaFX application launch sequence, setting the preloader system property before calling launch(). This is the standard pattern for JavaFX applications with custom preloaders.


96-97: LGTM: Correct JavaFX threading for post-initialization.

Wrapping dispatchPostInitialize() in Platform.runLater() ensures it executes on the JavaFX Application Thread after the UI is displayed. This is the correct pattern:

  1. init() completes on the Launcher thread (Spring context + FXML loading)
  2. start() displays the stage on the Application Thread
  3. Post-initialization (account loading, dialogs) runs on the Application Thread after the stage is visible

This provides proper thread safety for JavaFX component access in refreshAccounts() and dialog controllers.


81-81: LGTM: Accurate threading documentation.

The updated comment correctly documents that init() runs on the JavaFX-Launcher thread, clarifying the execution context for future maintainers.

owlplug-client/src/test/java/com/owlplug/AppTestContext.java (1)

29-29: Migration to @MockitoBean is correct for Spring Boot 4.0.1.

The change from @MockBean (deprecated in Spring Boot 3.4, removed in 4.0) to @MockitoBean with the updated import path is necessary and properly implemented. This aligns with Spring Framework 7's new bean override mechanism.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DropSnorz
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Dec 29, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@DropSnorz DropSnorz merged commit 6f163d6 into master Dec 29, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants