Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javadoc hover for parameterized method with insufficient context #1595

Closed
eric-milles opened this issue Sep 3, 2024 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@eric-milles
Copy link
Member

Consider the following:

@groovy.transfornm.TypeChecked
void test() {
  def list = Collections.emptyList()
}

Insufficient context exists to determine the list element type. Static type checking produces an "unresolved" type variable #T so list has an inferred type java.util.List<#T>. Code hover for list and emptyList fails to display due to error in method signature (see below).

java.lang.IllegalArgumentException: "<T:Ljava.lang.Object;>()Ljava.util.List<T" at 40
	at org.eclipse.jdt.internal.compiler.util.Util.newIllegalArgumentException(Util.java:1607)
	at org.eclipse.jdt.internal.compiler.util.Util.scanTypeVariableSignature(Util.java:1322)
	at org.eclipse.jdt.internal.compiler.util.Util.scanTypeSignature(Util.java:1194)
	at org.eclipse.jdt.internal.compiler.util.Util.scanTypeArgumentSignature(Util.java:1539)
	at org.eclipse.jdt.internal.compiler.util.Util.scanTypeArgumentSignatures(Util.java:1503)
	at org.eclipse.jdt.internal.compiler.util.Util.scanClassTypeSignature(Util.java:1404)
	at org.eclipse.jdt.internal.compiler.util.Util.scanTypeSignature(Util.java:1192)
	at org.eclipse.jdt.core.Signature.getReturnType(Signature.java:1887)
	at org.eclipse.jdt.core.Signature.getReturnType(Signature.java:1901)
	at org.eclipse.jdt.internal.core.manipulation.JavaElementLabelComposerCore.appendMethodPrependedReturnType(JavaElementLabelComposerCore.java:331)
	at org.eclipse.jdt.internal.ui.viewsupport.JavaElementLinks$JavaElementLinkedLabelComposer.appendMethodPrependedReturnType(JavaElementLinks.java:385)
	at org.eclipse.jdt.internal.core.manipulation.JavaElementLabelComposerCore.appendMethodLabel(JavaElementLabelComposerCore.java:257)
	at org.eclipse.jdt.internal.core.manipulation.JavaElementLabelComposerCore.appendElementLabel(JavaElementLabelComposerCore.java:174)
	at org.eclipse.jdt.internal.ui.viewsupport.JavaElementLinks$JavaElementLinkedLabelComposer.appendElementLabel(JavaElementLinks.java:359)
	at org.eclipse.jdt.internal.ui.viewsupport.JavaElementLinks.getElementLabel(JavaElementLinks.java:789)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getInfoText(JavadocHover.java:857)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:794)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:717)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:709)
	at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:163)
	at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:130)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:89)
	at org.eclipse.jface.text.TextViewerHoverManager$1.run(TextViewerHoverManager.java:155)
@eric-milles
Copy link
Member Author

image

eric-milles added a commit that referenced this issue Sep 30, 2024
- do not show type vars in javadoc display
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant