You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: clear tail tips when setTailTip receives null - #2334
setTailTip(null) is documented to clear the tail tip, but enabling TAIL_TIP autosuggestions then entering text throws a NullPointerException in redisplay.
Normalize null to the empty string in the setter. Add a reader regression that clears a previously configured tip and enters a command with tail-tip autosuggestions enabled.
Validation (JDK 25): the regression throws on the unchanged implementation; TERM=xterm mvn -q -pl reader -am verify passes after the fix (883 tests, 2 existing skips, no failures/errors). TERM=xterm avoids the unrelated warning-test failure caused by the local TERM=dumb environment.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
📝 Walkthrough
setTailTip now stores an empty string when passed null. A test checks that, with tail-tip suggestions enabled, clearing the tip still allows the entered command to be returned.
Changes: Tail-tip clearing
Layer / File(s)
Summary
Normalize and test cleared tail tips reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java, reader/src/test/java/org/jline/reader/impl/AutosuggestionTest.java
setTailTip stores an empty string for null. A test clears the tail tip and asserts that entering "command" returns "command".
The PR addresses the reported failure and is mergeable with normal checks.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: clearing tail tips when setTailTip receives null.
Linked Issues check
Issue #2332 requires setTailTip(null) to clear the tail tip and prevent readLine failure with SuggestionType.TAIL_TIP. LineReaderImpl.setTailTip now converts null to "". `AutosuggestionTes…
Out of Scope Changes check
The pull request changes only LineReaderImpl.setTailTip and adds its focused regression test. Both changes directly support issue #2332. No unrelated implementation or test changes are present in th…
Full details: Linked Issues check
Explanation
Issue #2332 requires setTailTip(null) to clear the tail tip and prevent readLine failure with SuggestionType.TAIL_TIP. LineReaderImpl.setTailTip now converts null to "". AutosuggestionTest.nullClearsTailTip enables tail-tip autosuggestions, sets and clears a tip, then enters command.
Full details: Out of Scope Changes check
Explanation
The pull request changes only LineReaderImpl.setTailTip and adds its focused regression test. Both changes directly support issue #2332. No unrelated implementation or test changes are present in the reviewed diff.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
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
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.
setTailTip(null)is documented to clear the tail tip, but enablingTAIL_TIPautosuggestions then entering text throws a NullPointerException in redisplay.Normalize null to the empty string in the setter. Add a reader regression that clears a previously configured tip and enters a command with tail-tip autosuggestions enabled.
Validation (JDK 25): the regression throws on the unchanged implementation;
TERM=xterm mvn -q -pl reader -am verifypasses after the fix (883 tests, 2 existing skips, no failures/errors).TERM=xtermavoids the unrelated warning-test failure caused by the localTERM=dumbenvironment.Fixes #2332.
Summary by CodeRabbit
nullnow behaves as expected, allowing the entered command to remain intact.