fix(refactoring): add ignoreCompileErrors escape hatch for compile-error blocks #100
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
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ai-tools/jdt-mcp-server!100
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/75-force-compile-errors"
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
jdt_encapsulate_fieldhard-blocks with no way to proceed when JDT'sSelfEncapsulateFieldRefactoringreports a pre-existing compile error whileanalyzing the field. Eclipse shows a "Continue anyway?" dialog for this;
headless mode has no equivalent, so the refactoring was simply stuck.
RefactoringSupport.getRealErrors()gains anignoreCompileErrorsoverloadthat filters status entries matching JDT's "compile error" wording.
jdt_encapsulate_fieldandjdt_rename_elementexpose it as an optionalparameter (default
false).null/NPE.resolve), the result reports that honestly instead of a false
SUCCESS.Deliberately excludes "syntax error" (
Checks.checkIfCuBroken) from theignorable markers: bypassing that specific JDT safety check left
ProcessorBasedRefactoring's participant machinery uninitialized and latersteps threw a raw
NullPointerExceptioninstead of a clean status — astructurally unparseable file cannot be safely forced through with the
current JDT version. Investigated and confirmed via bytecode inspection of
org.eclipse.jdt.core.manipulation(Checks.checkCompileErrorsInAffectedFile(s),SelfEncapsulateFieldRefactoring,Checks.checkIfCuBroken) plus empiricalreproduction against
fixture-broken.Test plan
tests/refactoring-test.sh(Test 4): blocked withoutthe flag (self-explanatory message), honest error (no false SUCCESS,
no NPE) when forced on a field whose type cannot resolve.
tests/refactoring-test.shfull suite: 6/6 passed.tests/smoke-test.sh: 9/9 passed.mvn clean packageproduct build.Closes #75
🤖 Generated with Claude Code
https://claude.ai/code/session_018q6miiQHwQYFgZBy71aUhL