Skip to content

Add Javadoc quick fix support for overridden methods#3820

Merged
jjohnstn merged 2 commits into
eclipse-jdtls:mainfrom
SougandhS:OverrideComments
Jun 25, 2026
Merged

Add Javadoc quick fix support for overridden methods#3820
jjohnstn merged 2 commits into
eclipse-jdtls:mainfrom
SougandhS:OverrideComments

Conversation

@SougandhS

Copy link
Copy Markdown
Contributor

Enable the "Add Javadoc comment" quick fix for methods that override parent methods. The generated Javadoc includes (non-Javadoc) marker and @see reference to the parent method.

OverMe

@eclipse-ls-bot

Copy link
Copy Markdown
Contributor

Can one of the admins verify this patch?

@SougandhS

SougandhS commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author
image

the new test - testAddJavadocForOverriddenMethodInRecord
was failing locally with

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)

Its an upstream issue - will be fixed once eclipse-jdt/eclipse.jdt.ui#3045 is merged

@SougandhS

Copy link
Copy Markdown
Contributor Author

Will update the other failing tests accordingly

Enable the "Add Javadoc comment" quick fix for methods that override
parent methods. The generated Javadoc includes (non-Javadoc) marker
and @see reference to the parent method.
@SougandhS

Copy link
Copy Markdown
Contributor Author

Hi @jjohnstn,
Could you please check this when you get some time ?

@jjohnstn jjohnstn self-requested a review June 24, 2026 20:43
@SougandhS

Copy link
Copy Markdown
Contributor Author

Unrelated build integration test failure :
image
passing on local

@jjohnstn

Copy link
Copy Markdown
Contributor

Hi @jjohnstn, Could you please check this when you get some time ?

Hi @SougandhS I was waiting for the jdt.ls release to occur. I still need to bump the release number then it should be fine for review/merge.

@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.

@jjohnstn jjohnstn merged commit a5127f7 into eclipse-jdtls:main Jun 25, 2026
6 of 7 checks passed
@SougandhS

Copy link
Copy Markdown
Contributor Author

Hi @SougandhS I was waiting for the jdt.ls release to occur. I still need to bump the release number then it should be fine for review/merge.

Cool 👍

Looks good.

Thanks!

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.

3 participants