Skip to content

Fix ClassCastException when generating unique parameter names for Records#3045

Merged
jjohnstn merged 1 commit into
eclipse-jdt:masterfrom
SougandhS:Abs
Jun 24, 2026
Merged

Fix ClassCastException when generating unique parameter names for Records#3045
jjohnstn merged 1 commit into
eclipse-jdt:masterfrom
SougandhS:Abs

Conversation

@SougandhS

@SougandhS SougandhS commented Jun 24, 2026

Copy link
Copy Markdown
Member

Fixes :

java.lang.ClassCastException: class org.eclipse.jdt.core.dom.RecordDeclaration cannot be cast to class org.eclipse.jdt.core.dom.TypeDeclaration (org.eclipse.jdt.core.dom.RecordDeclaration and org.eclipse.jdt.core.dom.TypeDeclaration are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @3da3cc2f)
	at org.eclipse.jdt.internal.corext.refactoring.code.makestatic.ChangeCalculator.generateUniqueParameterName(ChangeCalculator.java:227)
	at org.eclipse.jdt.internal.corext.refactoring.code.makestatic.ChangeCalculator.<init>(ChangeCalculator.java:130)
	at org.eclipse.jdt.internal.corext.refactoring.code.MakeStaticRefactoring.checkFinalConditions(MakeStaticRefactoring.java:177)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:87)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:116)
	at org.eclipse.jdt.ls.core.internal.corrections.RefactorProcessor$6.getChange(RefactorProcessor.java:1299)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler.getCodeActionFromProposal(CodeActionHandler.java:368)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler.getCodeActionCommands(CodeActionHandler.java:246)
	at org.eclipse.jdt.ls.core.internal.correction.AbstractQuickFixTest.evaluateCodeActions(AbstractQuickFixTest.java:316)
	at org.eclipse.jdt.ls.core.internal.correction.AbstractQuickFixTest.evaluateCodeActions(AbstractQuickFixTest.java:293)
	at org.eclipse.jdt.ls.core.internal.correction.AbstractQuickFixTest.assertCodeActions(AbstractQuickFixTest.java:130)
	at org.eclipse.jdt.ls.core.internal.correction.JavadocQuickFixTest.testAddJavadocForOverriddenMethodInRecord(JavadocQuickFixTest.java:1206)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

What it does

How to test

Author checklist

@SougandhS

Copy link
Copy Markdown
Member Author

@SougandhS SougandhS requested a review from jjohnstn June 24, 2026 14:57

@jjohnstn jjohnstn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks.

@jjohnstn jjohnstn merged commit 3399a36 into eclipse-jdt:master Jun 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants