Skip to content

Fix Javadoc for exitValue method exception tag#348

Merged
vorburger merged 1 commit into
mainfrom
vorburger-patch-1
Apr 7, 2026
Merged

Fix Javadoc for exitValue method exception tag#348
vorburger merged 1 commit into
mainfrom
vorburger-patch-1

Conversation

@vorburger
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 7, 2026 19:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Javadoc on ManagedProcess#exitValue() to use the standard @throws tag for documenting ManagedProcessException.

Changes:

  • Replaced @exception with @throws in the exitValue() method Javadoc.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Javadoc for the exitValue method in ManagedProcess.java, changing the @exception tag to @throws. Feedback indicates that the Javadoc description remains misleading because the implementation blocks until the process terminates, which deviates from the standard java.lang.Process.exitValue() behavior, and it lacks necessary checks to prevent indefinite blocking if the process was never started.

* @return the exit value of the subprocess represented by this <code>Process</code> object. by
* convention, the value <code>0</code> indicates normal termination.
* @exception ManagedProcessException if the subprocess represented by this <code>ManagedProcess
* @throws ManagedProcessException if the subprocess represented by this <code>ManagedProcess
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The Javadoc description for this method (which continues on line 445) is misleading. It states that a ManagedProcessException is thrown if the subprocess has not yet terminated, but the implementation actually calls asyncResult.get(), which blocks until the process terminates. This behavior differs significantly from java.lang.Process.exitValue(), which is non-blocking and throws an exception if the process is still running. Furthermore, the current implementation will block indefinitely if the process was never started, as it lacks the assertWaitForIsValid() check found in the waitForExit methods.

@vorburger vorburger enabled auto-merge (squash) April 7, 2026 20:01
@vorburger vorburger disabled auto-merge April 7, 2026 20:01
@vorburger vorburger merged commit a620d63 into main Apr 7, 2026
8 checks passed
@vorburger vorburger deleted the vorburger-patch-1 branch April 7, 2026 21:19
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