Review: eclipse.jdt.core#14 stale buffer fix — critical gap in Openable.getBuffer()#679
Closed
carstenartur with Copilot wants to merge 2 commits into
Closed
Review: eclipse.jdt.core#14 stale buffer fix — critical gap in Openable.getBuffer()#679carstenartur with Copilot wants to merge 2 commits into
carstenartur with Copilot wants to merge 2 commits into
Conversation
…d solution Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review fix for issue in eclipse.jdt.core
Review: eclipse.jdt.core#14 stale buffer fix — critical gap in Openable.getBuffer()
Feb 11, 2026
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.
Analysis of carstenartur/eclipse.jdt.core#14 which proposes fixing intermittent
source=nullfailures inAnnotateAssistTest1d8(eclipse-jdt/eclipse.jdt.ui#736) by detecting stale buffers inClassFile.openBuffer()andModularClassFile.openBuffer().Finding: Fix is in the wrong method
The PR adds stale buffer detection in
openBuffer(), butopenBuffer()is only called when the cache returns null. For top-level class files (the actual failing case),Openable.getBuffer()finds the stale buffer directly in cache and returns it —openBuffer()is never reached:Recommended fix
The primary fix must be in
Openable.getBuffer():Additional findings
removeLibrary()/addLibrary()run synchronously, no race window.Openable.getBuffer()already performs. Should be reverted.isClosed()notgetCharacters() == null— more semantically precise, avoids false positives on unfilled buffers, consistent with existingbufferChanged()check.Full analysis in
jdt_core_stale_buffer_fix_review.md.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.