Bug 572681 - Hover gives IllegalArgumentException
Summary: Hover gives IllegalArgumentException
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.20   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.24   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact: Sravan Kumar Lakkimsetti CLA
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2021-04-08 05:40 EDT by Manoj N Palat CLA
Modified: 2024-02-10 16:01 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj N Palat CLA 2021-04-08 05:40:27 EDT
Use the example from 562324 comment 11 - reproduced below:

import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collector;

public class X  {

	public static void main(String[] args) {
		List<String> taskNames = Arrays.asList("First", "Second", "Third");
		
		// hover over services
		var services = taskNames.stream().collect(X.toSet(name -> new Y(){}));
    
		String[] names = services.stream().map(e -> e).toArray(String[] :: new);
	}
	
    public static <T, U>
    Collector<T, ?, Set<U>> toSet(Function<? super T, ? extends U> valueMapper) {
    	return null;
    }

}

abstract class Y{}


Hover over services in var services =...
to get an IllegalArgumentException with the following ST:

java.lang.IllegalArgumentException: java.util.Set<new Y(){}>
	at org.eclipse.jdt.core.Signature.checkNextChar(Signature.java:1025)
	at org.eclipse.jdt.core.Signature.encodeTypeSignature(Signature.java:1507)
	at org.eclipse.jdt.core.Signature.createCharArrayTypeSignature(Signature.java:1095)
	at org.eclipse.jdt.core.Signature.createTypeSignature(Signature.java:1293)
	at org.eclipse.jdt.internal.core.SelectionRequestor.acceptLocalVariable(SelectionRequestor.java:488)
	at org.eclipse.jdt.internal.codeassist.SelectionEngine.selectFrom(SelectionEngine.java:1393)
	at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:1096)
	at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:167)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:389)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:382)
	at org.eclipse.jdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover.getJavaElementsAt(AbstractJavaEditorTextHover.java:121)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:662)
	at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:658)
	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)
Comment 1 Manoj N Palat CLA 2021-05-21 00:10:01 EDT
Bulk move out of 4.20
Comment 2 Manoj N Palat CLA 2022-02-16 05:10:38 EST
Bulk move out of 4.23
Comment 3 Manoj N Palat CLA 2022-02-16 05:11:06 EST
Bulk move out of 4.23
Comment 4 Manoj N Palat CLA 2022-02-16 05:11:41 EST
Bulk move out of 4.23
Comment 5 Manoj N Palat CLA 2022-02-16 05:11:41 EST
Bulk move out of 4.23
Comment 6 Eclipse Genie CLA 2024-02-10 16:01:03 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.