jdt_rename_element: references not updated across multi-module workspace #15

Closed
opened 2026-03-07 13:00:26 +00:00 by automation · 0 comments
Collaborator

Environment

  • jdt-mcp-server: current version
  • Workspace: 29 Maven modules across 2 Git repos (rdf: 4 modules, platform: 25 modules)
  • Java 25, Maven multi-module

Problem

jdt_rename_element reports "status": "SUCCESS" but fails to update references in many files. The rename only modifies the declaration file, not the call sites.

Reproduction

1. Class Rename — partial reference updates

Renamed GraphServiceRepositoryGraphServiceProvider (interface in rdf-api module).

  • Declaration file: renamed correctly (file + class name)
  • References in same module (rdf-api): updated
  • References in rdf-rdf4j module: NOT updated (3 files with imports + usages)
  • References in platform modules: NOT updated (14 files)

The response showed "changes": {"children": [], "childCount": 0} — indicating JDT found zero references to update.

Same behavior for CollectionStoresCollectionIndex and GraphQueryService4AdminAdminGraphQueryService.

2. Field Rename — zero reference updates

Renamed 6 fields in VocabSchemaOrg interface (e.g., HAS_NAMENAME).

  • Declaration: updated correctly
  • References in rdf-rdf4j (8 files): NOT updated
  • References in platform (12 files): NOT updated
  • All returned "childCount": 0

3. Record Component Rename — partial

Renamed GraphLocator#proxyIripublicIri (record component).

  • Record component: renamed
  • Auto-generated accessor publicIri(): renamed
  • Delegate methods Draft.proxyIri() / Version.proxyIri(): NOT renamed (these are separate methods calling locator.publicIri())
  • All call sites like graphLocator.proxyIri(): NOT updated

4. Method Rename on interface — only one overload

Renamed GraphQueryService#getCurrentPublishedProxyGraph. Interface had 3 overloads:

  • getCurrentPublishedProxyGraph(GraphLocator)renamed
  • getCurrentPublishedProxyGraph(GraphLocator, int, String)NOT renamed
  • getCurrentPublishedProxyGraph(IRI)NOT renamed

Implementation class GraphQueryServiceImpl: NOT renamed for any overload.

Observed Pattern

  • JDT renames the declaration correctly every time
  • JDT fails to find/update references in other compilation units
  • childCount: 0 in the response is the indicator
  • Affects cross-module references most, but even same-module references in rdf-rdf4j were missed

Additional: Eclipse participant errors

First call in a session often fails with:

ERROR: The participant 'Launch configuration participant' has caused a problem
ERROR: The participant 'Breakpoint participant' has caused a problem
ERROR: The participant 'Watchpoint participant' has caused a problem

Retry succeeds. Parallel rename calls always fail — sequential works.

Impact

In our refactoring session (rdf#1), JDT handled ~60% of declarations but 0% of cross-module references. All references had to be fixed via sed. The "status": "SUCCESS" with childCount: 0 is misleading — it should at minimum warn that no references were found.

Expected Behavior

  1. jdt_rename_element should update all references across the workspace
  2. If references can't be updated, status should reflect this (not SUCCESS)
  3. The response should list affected files (like preview: true would)
## Environment - jdt-mcp-server: current version - Workspace: 29 Maven modules across 2 Git repos (rdf: 4 modules, platform: 25 modules) - Java 25, Maven multi-module ## Problem `jdt_rename_element` reports `"status": "SUCCESS"` but fails to update references in many files. The rename only modifies the declaration file, not the call sites. ## Reproduction ### 1. Class Rename — partial reference updates Renamed `GraphServiceRepository` → `GraphServiceProvider` (interface in rdf-api module). - Declaration file: renamed correctly (file + class name) - References in **same module** (rdf-api): updated - References in **rdf-rdf4j module**: **NOT updated** (3 files with imports + usages) - References in **platform modules**: **NOT updated** (14 files) The response showed `"changes": {"children": [], "childCount": 0}` — indicating JDT found zero references to update. Same behavior for `CollectionStores` → `CollectionIndex` and `GraphQueryService4Admin` → `AdminGraphQueryService`. ### 2. Field Rename — zero reference updates Renamed 6 fields in `VocabSchemaOrg` interface (e.g., `HAS_NAME` → `NAME`). - Declaration: updated correctly - References in rdf-rdf4j (8 files): **NOT updated** - References in platform (12 files): **NOT updated** - All returned `"childCount": 0` ### 3. Record Component Rename — partial Renamed `GraphLocator#proxyIri` → `publicIri` (record component). - Record component: renamed - Auto-generated accessor `publicIri()`: renamed - Delegate methods `Draft.proxyIri()` / `Version.proxyIri()`: **NOT renamed** (these are separate methods calling `locator.publicIri()`) - All call sites like `graphLocator.proxyIri()`: **NOT updated** ### 4. Method Rename on interface — only one overload Renamed `GraphQueryService#getCurrentPublishedProxyGraph`. Interface had 3 overloads: - `getCurrentPublishedProxyGraph(GraphLocator)` — **renamed** - `getCurrentPublishedProxyGraph(GraphLocator, int, String)` — **NOT renamed** - `getCurrentPublishedProxyGraph(IRI)` — **NOT renamed** Implementation class `GraphQueryServiceImpl`: **NOT renamed** for any overload. ## Observed Pattern - JDT renames the **declaration** correctly every time - JDT fails to find/update **references** in other compilation units - `childCount: 0` in the response is the indicator - Affects cross-module references most, but even same-module references in rdf-rdf4j were missed ## Additional: Eclipse participant errors First call in a session often fails with: ``` ERROR: The participant 'Launch configuration participant' has caused a problem ERROR: The participant 'Breakpoint participant' has caused a problem ERROR: The participant 'Watchpoint participant' has caused a problem ``` Retry succeeds. Parallel rename calls always fail — sequential works. ## Impact In our refactoring session (rdf#1), JDT handled ~60% of declarations but 0% of cross-module references. All references had to be fixed via `sed`. The `"status": "SUCCESS"` with `childCount: 0` is misleading — it should at minimum warn that no references were found. ## Expected Behavior 1. `jdt_rename_element` should update all references across the workspace 2. If references can't be updated, status should reflect this (not SUCCESS) 3. The response should list affected files (like `preview: true` would)
fred closed this issue 2026-03-07 14:02:41 +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#15
No description provided.