jdt_rename_element FIELD still fails with IllegalArgumentException (regression from #20) #22

Closed
opened 2026-03-07 16:42:24 +00:00 by automation · 0 comments
Collaborator

Problem

jdt_rename_element with elementType=FIELD still fails with the same IllegalArgumentException that was reported in #20 and supposedly fixed in #21. The bug is reproducible with v0.2.14.

Reproduction

Environment:

  • jdtls-mcp v0.2.14 (jdtls-mcp --versionJDT MCP Server 0.2.14)
  • Java 25, Linux
  • Workspace: 29 Maven modules (multi-module, two repos)
  • JAR verified as current (no (deleted) in /proc/<PID>/fd)

Call:

{
  "elementName": "com.culinarygraph.rdf.vocab.VocabCg#HAS_ITEM",
  "newName": "ITEM",
  "elementType": "FIELD",
  "preview": true,
  "updateReferences": true
}

Error:

IllegalArgumentException
  at org.eclipse.core.resources.ProjectScope.getNode(ProjectScope.java:69)
  at org.eclipse.jdt.core.manipulation.JavaManipulation.getPreference(JavaManipulation.java:111)
  at org.eclipse.jdt.internal.core.manipulation.StubUtility.useIsForBooleanGetters(StubUtility.java:1633)
  at org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil.getSetterName(GetterSetterUtil.java:88)
  at org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil.getSetterName(GetterSetterUtil.java:96)

Analysis

The stack trace is identical to #20. The fix in #21 ("disable getter/setter renaming in headless mode") does not prevent this code path from being reached. GetterSetterUtil.getSetterName is still called during field rename, and ProjectScope.getNode fails because there is no Eclipse project nature/preferences in headless mode.

Expected Behavior

Field rename (with preview=true) should return a preview of changes without throwing an exception.

  • #20 (original report, closed)
  • #21 (attempted fix, closed)
## Problem `jdt_rename_element` with `elementType=FIELD` still fails with the same `IllegalArgumentException` that was reported in #20 and supposedly fixed in #21. The bug is reproducible with v0.2.14. ## Reproduction **Environment:** - jdtls-mcp v0.2.14 (`jdtls-mcp --version` → `JDT MCP Server 0.2.14`) - Java 25, Linux - Workspace: 29 Maven modules (multi-module, two repos) - JAR verified as current (no `(deleted)` in `/proc/<PID>/fd`) **Call:** ```json { "elementName": "com.culinarygraph.rdf.vocab.VocabCg#HAS_ITEM", "newName": "ITEM", "elementType": "FIELD", "preview": true, "updateReferences": true } ``` **Error:** ``` IllegalArgumentException at org.eclipse.core.resources.ProjectScope.getNode(ProjectScope.java:69) at org.eclipse.jdt.core.manipulation.JavaManipulation.getPreference(JavaManipulation.java:111) at org.eclipse.jdt.internal.core.manipulation.StubUtility.useIsForBooleanGetters(StubUtility.java:1633) at org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil.getSetterName(GetterSetterUtil.java:88) at org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil.getSetterName(GetterSetterUtil.java:96) ``` ## Analysis The stack trace is identical to #20. The fix in #21 ("disable getter/setter renaming in headless mode") does not prevent this code path from being reached. `GetterSetterUtil.getSetterName` is still called during field rename, and `ProjectScope.getNode` fails because there is no Eclipse project nature/preferences in headless mode. ## Expected Behavior Field rename (with `preview=true`) should return a preview of changes without throwing an exception. ## Related - #20 (original report, closed) - #21 (attempted fix, closed)
fred closed this issue 2026-03-07 16:53:37 +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#22
No description provided.