Add comment to ProgressCallback doc#5286
Merged
holgerfriedrich merged 1 commit intoopenhab:mainfrom Feb 14, 2026
Merged
Conversation
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
There was a problem hiding this comment.
Pull request overview
This PR adds documentation to clarify a non-intuitive behavior in the ProgressCallback interface where calling update() before next() will automatically advance the internal iterator to the first state.
Changes:
- Added a note to the
update()method documentation explaining the iterator advancement behavior - Reformatted the
@throwsclause for better readability
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * This method can be used to provide detailed progress information additional to the sequence or even without a | ||
| * previous defined sequence. | ||
| * <br> | ||
| * Note that calling this method before the first call to next() will cause the iterator to be stepped to the first |
There was a problem hiding this comment.
The phrase "will cause the iterator to be stepped" should be "will cause the iterator to step" or "will step the iterator" for better readability. The passive voice construction here is awkward.
Suggested change
| * Note that calling this method before the first call to next() will cause the iterator to be stepped to the first | |
| * Note that calling this method before the first call to next() will step the iterator to the first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ProgressCallbackuses an iterator to step through the states, and there's no way to know the current state from the binding. The user is expected to call thenextmethod to step the states, but the iterator is also stepped ifupdateis called before the first call tonext.This doesn't feel very nice to me, and I would have preferred to handle this differently, but I didn't want to break the implementation in case others rely on this. Instead I've just added a note to the doc.
Signed-off-by: Chris Jackson chris@cd-jackson.com