Run system file and browser opening asynchronously#475
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Walkthrough
ChangesAsync file and URL opening
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
owlplug-client/src/main/java/com/owlplug/core/utils/PlatformUtils.java (1)
80-81: ⚡ Quick winRestore interrupt flag after catching
InterruptedException.When an
InterruptedExceptionis caught, the thread's interrupt flag is cleared. Best practice is to restore it so the thread pool can respond to shutdown signals properly.Proposed fix
} catch (InterruptedException e) { + Thread.currentThread().interrupt(); log.error("Thread interrupted while waiting for xdg-open to finish", e); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@owlplug-client/src/main/java/com/owlplug/core/utils/PlatformUtils.java` around lines 80 - 81, The catch block in PlatformUtils that logs "Thread interrupted while waiting for xdg-open to finish" should restore the thread's interrupt status after logging; update the InterruptedException handler in the method that calls xdg-open (within class PlatformUtils) to call Thread.currentThread().interrupt() immediately after log.error(...) so the interrupt flag is preserved for higher-level shutdown/cleanup logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@owlplug-client/src/main/java/com/owlplug/core/utils/PlatformUtils.java`:
- Around line 48-53: In PlatformUtils.openFile(File file) the code checks
Desktop.isDesktopSupported() but not Desktop.isSupported(Action.OPEN), which can
lead to UnsupportedOperationException when calling
Desktop.getDesktop().open(file); update the method to first check
Desktop.isSupported(Desktop.Action.OPEN) (in addition to
Desktop.isDesktopSupported()) and log+return if not supported, or alternatively
catch UnsupportedOperationException around Desktop.getDesktop().open(file) and
log a warning including file.getAbsolutePath(); reference the PlatformUtils
class and the openFile method to locate and apply this change.
---
Nitpick comments:
In `@owlplug-client/src/main/java/com/owlplug/core/utils/PlatformUtils.java`:
- Around line 80-81: The catch block in PlatformUtils that logs "Thread
interrupted while waiting for xdg-open to finish" should restore the thread's
interrupt status after logging; update the InterruptedException handler in the
method that calls xdg-open (within class PlatformUtils) to call
Thread.currentThread().interrupt() immediately after log.error(...) so the
interrupt flag is preserved for higher-level shutdown/cleanup logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 29251224-68a1-47b8-af7f-eb8d79e7140c
📒 Files selected for processing (1)
owlplug-client/src/main/java/com/owlplug/core/utils/PlatformUtils.java
c599ccd to
633505d
Compare
No description provided.