jdt_rename_element: Silent no-op — reports SUCCESS but changes nothing (v0.2.16) #26

Closed
opened 2026-03-07 17:43:04 +00:00 by automation · 2 comments
Collaborator

Description

jdt_rename_element reports status: SUCCESS but does not modify any files. Neither the declaration nor any references are updated.

Environment

  • JDT MCP Server version: 0.2.16
  • Workspace: Multi-module Maven project (29 modules across 2 repos)

Steps to Reproduce

  1. Field CACHED_AT is declared in com.culinarygraph.rdf.vocab.VocabCg (interface constant)
  2. 12 references exist in 3 files in a separate repo within the same workspace
jdt_rename_element:
  elementName: com.culinarygraph.rdf.vocab.VocabCg#CACHED_AT
  newName: CACHED_AT_TEST
  elementType: FIELD
  updateReferences: true
  preview: false

Actual Result

Response reports success with childCount: 0:

{
  "status": "SUCCESS",
  "message": "Refactoring completed successfully",
  "changes": {
    "name": "Rename Field",
    "childCount": 1,
    "children": [
      {
        "name": "Rename Field",
        "childCount": 0,
        "children": []
      }
    ]
  }
}

But no files were modified. grep confirms all 13 occurrences still have the old name CACHED_AT. CACHED_AT_TEST appears nowhere.

Expected Result

  • Declaration in VocabCg.java renamed to CACHED_AT_TEST
  • All 12 references in platform updated to CACHED_AT_TEST
  • Or: status: ERROR if the rename cannot be performed

Notes

  • Preview (preview: true) also returns successfully with the same empty childCount: 0
  • The field is an interface constant (IRI CACHED_AT = ... in a Java interface)
  • Previous version (v0.2.15) threw NullPointerException on the same operation (#24)
  • So the NPE is fixed, but the rename itself is now a silent no-op
## Description `jdt_rename_element` reports `status: SUCCESS` but does not modify any files. Neither the declaration nor any references are updated. ## Environment - **JDT MCP Server version:** 0.2.16 - **Workspace:** Multi-module Maven project (29 modules across 2 repos) ## Steps to Reproduce 1. Field `CACHED_AT` is declared in `com.culinarygraph.rdf.vocab.VocabCg` (interface constant) 2. 12 references exist in 3 files in a separate repo within the same workspace ``` jdt_rename_element: elementName: com.culinarygraph.rdf.vocab.VocabCg#CACHED_AT newName: CACHED_AT_TEST elementType: FIELD updateReferences: true preview: false ``` ## Actual Result Response reports success with `childCount: 0`: ```json { "status": "SUCCESS", "message": "Refactoring completed successfully", "changes": { "name": "Rename Field", "childCount": 1, "children": [ { "name": "Rename Field", "childCount": 0, "children": [] } ] } } ``` **But no files were modified.** `grep` confirms all 13 occurrences still have the old name `CACHED_AT`. `CACHED_AT_TEST` appears nowhere. ## Expected Result - Declaration in `VocabCg.java` renamed to `CACHED_AT_TEST` - All 12 references in platform updated to `CACHED_AT_TEST` - Or: `status: ERROR` if the rename cannot be performed ## Notes - Preview (`preview: true`) also returns successfully with the same empty `childCount: 0` - The field is an interface constant (`IRI CACHED_AT = ...` in a Java interface) - Previous version (v0.2.15) threw `NullPointerException` on the same operation (#24) - So the NPE is fixed, but the rename itself is now a silent no-op
Author
Collaborator

Test Case & History

# Test: JDT MCP Cross-Modul Rename nach Fix jdt-mcp-server#15

## Kontext
- Fix für jdt-mcp-server#15 wurde deployed
- Workspace: `/tmp/testprj` mit `rdf/` + `platform/` (29 Module)
- Ziel: Verifizieren dass `jdt_rename_element` jetzt Referenzen cross-modul aktualisiert

## Testergebnis (2026-03-07, v0.2.15)

### Status: FEHLGESCHLAGEN — NullPointerException

**Getestetes Feld:** `VocabCg#CACHED_AT` (definiert in rdf-api, 12 Referenzen in 3 platform-Dateien)

**Fehler:** `NullPointerException` in `ProcessorBasedRefactoring.createChange`

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

- Bug: **jdt-mcp-server#24**

## Testergebnis (2026-03-07, v0.2.16)

### Status: FEHLGESCHLAGEN — Silent no-op

- NPE aus #24 ist gefixt
- Rename meldet `status: SUCCESS` mit `childCount: 0`
- **Aber 0 Dateien geändert** — weder Deklaration noch Referenzen
- `CACHED_AT_TEST` taucht nirgends auf, alle 13 Stellen haben noch `CACHED_AT`
- Bug: **jdt-mcp-server#26**

### Fazit
- `jdt_rename_element` bleibt blockiert
- Workaround: weiterhin `sed` für Cross-Modul-Renames

## Testplan (für nächsten Versuch)

### 1. Vorher-Zustand erfassen

    grep -rn "CACHED_AT" --include="*.java" rdf/ platform/ | wc -l

Erwartet: 13 Vorkommen in 4 Dateien

### 2. Test-Rename durchführen (reversibel!)

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

### 3. Prüfen
- [ ] `jdt_rename_element` meldet `childCount > 0`?
- [ ] Referenzen in platform aktualisiert?
- [ ] `mvn compile` in rdf grün?
- [ ] `jdt_get_compilation_errors` stimmt mit `mvn compile` überein?

### 4. Revert

    git -C rdf checkout . && git -C platform checkout .
## Test Case & History ```markdown # Test: JDT MCP Cross-Modul Rename nach Fix jdt-mcp-server#15 ## Kontext - Fix für jdt-mcp-server#15 wurde deployed - Workspace: `/tmp/testprj` mit `rdf/` + `platform/` (29 Module) - Ziel: Verifizieren dass `jdt_rename_element` jetzt Referenzen cross-modul aktualisiert ## Testergebnis (2026-03-07, v0.2.15) ### Status: FEHLGESCHLAGEN — NullPointerException **Getestetes Feld:** `VocabCg#CACHED_AT` (definiert in rdf-api, 12 Referenzen in 3 platform-Dateien) **Fehler:** `NullPointerException` in `ProcessorBasedRefactoring.createChange` Cannot invoke "java.util.List.size()" because "this.fParticipants" is null - Bug: **jdt-mcp-server#24** ## Testergebnis (2026-03-07, v0.2.16) ### Status: FEHLGESCHLAGEN — Silent no-op - NPE aus #24 ist gefixt - Rename meldet `status: SUCCESS` mit `childCount: 0` - **Aber 0 Dateien geändert** — weder Deklaration noch Referenzen - `CACHED_AT_TEST` taucht nirgends auf, alle 13 Stellen haben noch `CACHED_AT` - Bug: **jdt-mcp-server#26** ### Fazit - `jdt_rename_element` bleibt blockiert - Workaround: weiterhin `sed` für Cross-Modul-Renames ## Testplan (für nächsten Versuch) ### 1. Vorher-Zustand erfassen grep -rn "CACHED_AT" --include="*.java" rdf/ platform/ | wc -l Erwartet: 13 Vorkommen in 4 Dateien ### 2. Test-Rename durchführen (reversibel!) jdt_rename_element: elementName: com.culinarygraph.rdf.vocab.VocabCg#CACHED_AT newName: CACHED_AT_TEST elementType: FIELD updateReferences: true ### 3. Prüfen - [ ] `jdt_rename_element` meldet `childCount > 0`? - [ ] Referenzen in platform aktualisiert? - [ ] `mvn compile` in rdf grün? - [ ] `jdt_get_compilation_errors` stimmt mit `mvn compile` überein? ### 4. Revert git -C rdf checkout . && git -C platform checkout . ```
Author
Collaborator

Das Testprojekt liegt unter /tmp/testprj/ mit zwei Repos (rdf/ + platform/), beide als JDT-Projekte im selben Workspace importiert.

Das Testprojekt liegt unter `/tmp/testprj/` mit zwei Repos (`rdf/` + `platform/`), beide als JDT-Projekte im selben Workspace importiert.
fred closed this issue 2026-03-08 09:37:19 +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#26
No description provided.