fix: initialize fParticipants via reflection to prevent NPE in headless rename (#24) #25
No reviewers
Labels
No labels
bug
build
enhancement
headless
P1-critical
P2-high
P3-medium
P4-low
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ai-tools/jdt-mcp-server!25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/24-fparticipants-npe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
NullPointerExceptioninProcessorBasedRefactoring.createChange()when renaming fields in headless modecheckAllConditionsthrowsIllegalArgumentException(#22 fallback), so onlycheckInitialConditionsruns — butfParticipantsis only initialized incheckFinalConditionsafter the processor check that throws the IAEProcessorBasedRefactoring.checkFinalConditionsconfirmed that calling it in a try-catch would not help (IAE is thrown beforefParticipantsassignment)ensureParticipantsInitialized()setsfParticipantstoCollections.emptyList()via reflection if still null beforecreateChange()Test plan
preview: trueandpreview: false)~/.jdt-mcp/jdt-mcp.logfor the reflection warning when field rename fallback is triggeredCloses #24