jdt_rename_element: NullPointerException in ProcessorBasedRefactoring.createChange (fParticipants is null) #24

Closed
opened 2026-03-07 17:11:10 +00:00 by automation · 0 comments
Collaborator

Version

jdt-mcp-server 0.2.15

Description

jdt_rename_element fails with a NullPointerException when renaming a field. This is a different error than #20 (which was IllegalArgumentException in ProjectScope.getNode), suggesting that fix resolved the previous issue but a new code path is now reached where fParticipants is not initialized.

Steps to Reproduce

Workspace with two multi-module Maven projects (rdf with 10 modules, platform with 19 modules).

Rename an interface field with cross-module references:

elementName: com.culinarygraph.rdf.vocab.VocabCg#CACHED_AT
newName: CACHED_AT_TEST
elementType: FIELD
updateReferences: true

The field is defined in rdf-api and referenced in 3 files across the platform project (12 occurrences total).

Error

NullPointerException: Cannot invoke "java.util.List.size()" because "this.fParticipants" is null

Stack Trace

org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:293)
org.naturzukunft.jdt.mcp.tools.RefactoringTools.renameElement(RefactoringTools.java:215)
org.naturzukunft.jdt.mcp.tools.RefactoringTools.lambda$0(RefactoringTools.java:94)
org.naturzukunft.jdt.mcp.server.McpProtocolHandler.handleToolsCall(McpProtocolHandler.java:238)
org.naturzukunft.jdt.mcp.server.McpProtocolHandler.handleMessage(McpProtocolHandler.java:91)

Same error occurs with preview: true (line 207) and preview: false (line 215).

  • #20 — previous IllegalArgumentException (likely fixed, this is the next blocker)
  • #15 — original cross-module rename issue
## Version jdt-mcp-server **0.2.15** ## Description `jdt_rename_element` fails with a `NullPointerException` when renaming a field. This is a **different** error than #20 (which was `IllegalArgumentException` in `ProjectScope.getNode`), suggesting that fix resolved the previous issue but a new code path is now reached where `fParticipants` is not initialized. ## Steps to Reproduce Workspace with two multi-module Maven projects (`rdf` with 10 modules, `platform` with 19 modules). Rename an interface field with cross-module references: ``` elementName: com.culinarygraph.rdf.vocab.VocabCg#CACHED_AT newName: CACHED_AT_TEST elementType: FIELD updateReferences: true ``` The field is defined in `rdf-api` and referenced in 3 files across the `platform` project (12 occurrences total). ## Error ``` NullPointerException: Cannot invoke "java.util.List.size()" because "this.fParticipants" is null ``` ## Stack Trace ``` org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:293) org.naturzukunft.jdt.mcp.tools.RefactoringTools.renameElement(RefactoringTools.java:215) org.naturzukunft.jdt.mcp.tools.RefactoringTools.lambda$0(RefactoringTools.java:94) org.naturzukunft.jdt.mcp.server.McpProtocolHandler.handleToolsCall(McpProtocolHandler.java:238) org.naturzukunft.jdt.mcp.server.McpProtocolHandler.handleMessage(McpProtocolHandler.java:91) ``` Same error occurs with `preview: true` (line 207) and `preview: false` (line 215). ## Related - #20 — previous `IllegalArgumentException` (likely fixed, this is the next blocker) - #15 — original cross-module rename issue
fred closed this issue 2026-03-07 17:32:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ai-tools/jdt-mcp-server#24
No description provided.