This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250999 - java.lang.IllegalArgumentException: Unsupported type: <any?>, kind: OTHER
Summary: java.lang.IllegalArgumentException: Unsupported type: <any?>, kind: OTHER
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-08 00:11 UTC by everflux
Modified: 2015-07-13 15:50 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description everflux 2015-03-08 00:11:17 UTC
Product Version: NetBeans IDE Dev (Build 201503060001)
Java: 1.8.0_40; Java HotSpot(TM) 64-Bit Server VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Linux version 3.16.0-31-generic running on amd64; UTF-8; en_US (nb)

code:

 report.getRequestHeaders().entrySet().stream()
                .collect(
                        Collectors.reducing(
                                "", Map.Entry::getKey + ": " + Map.Entry::getV

from messages:

INFO [org.netbeans.modules.java.hints.providers.code.CodeHintProviderImpl$WorkerImpl]: org.netbeans.modules.java.hints.suggestions.Lambda.reference2Lambda
java.lang.IllegalArgumentException: Unsupported type: <any?>, kind: OTHER
        at org.netbeans.modules.java.source.usages.ClassFileUtil.encodeType(ClassFileUtil.java:318)
        at org.netbeans.modules.java.source.usages.ClassFileUtil.createExecutableDescriptor(ClassFileUtil.java:198)
        at org.netbeans.api.java.source.ElementHandle.createImpl(ElementHandle.java:458)
        at org.netbeans.api.java.source.ElementHandle.create(ElementHandle.java:397)
        at org.netbeans.api.java.source.TreePathHandle.create(TreePathHandle.java:268)
        at org.netbeans.spi.java.hints.JavaFix.<init>(JavaFix.java:120)
        at org.netbeans.spi.java.hints.JavaFix.<init>(JavaFix.java:102)
        at org.netbeans.modules.java.hints.suggestions.Lambda$MemberReference2Lambda.<init>(Lambda.java:471)
        at org.netbeans.modules.java.hints.suggestions.Lambda.reference2Lambda(Lambda.java:226)
Caused: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
[catch] at org.netbeans.modules.java.hints.providers.code.CodeHintProviderImpl$WorkerImpl.createErrors(CodeHintProviderImpl.java:336)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.runHint(HintsInvoker.java:798)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.access$400(HintsInvoker.java:111)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.runAndAdd(HintsInvoker.java:657)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scanDoNotGoDeeper(HintsInvoker.java:711)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeSuggestions(HintsInvoker.java:396)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:232)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:209)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:182)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:149)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:114)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:83)
        at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:298)
        at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:584)
        at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:809)
        at org.openide.util.lookup.Lookups.executeWith(Lookups.java:304)
        at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:725)
        at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:686)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1425)
        at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
        at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2038)
SEVERE [org.openide.util.Exceptions]
java.lang.IllegalArgumentException: Unsupported type: <any?>, kind: OTHER
        at org.netbeans.modules.java.source.usages.ClassFileUtil.encodeType(ClassFileUtil.java:318)
        at org.netbeans.modules.java.source.usages.ClassFileUtil.createExecutableDescriptor(ClassFileUtil.java:198)
        at org.netbeans.api.java.source.ElementHandle.createImpl(ElementHandle.java:458)
        at org.netbeans.api.java.source.ElementHandle.create(ElementHandle.java:397)
        at org.netbeans.api.java.source.TreePathHandle.create(TreePathHandle.java:268)
        at org.netbeans.spi.java.hints.JavaFix.<init>(JavaFix.java:120)
        at org.netbeans.spi.java.hints.JavaFix.<init>(JavaFix.java:102)
        at org.netbeans.modules.java.hints.suggestions.Lambda$MemberReference2Lambda.<init>(Lambda.java:471)
        at org.netbeans.modules.java.hints.suggestions.Lambda.reference2Lambda(Lambda.java:226)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
[catch] at org.netbeans.modules.java.hints.providers.code.CodeHintProviderImpl$WorkerImpl.createErrors(CodeHintProviderImpl.java:336)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.runHint(HintsInvoker.java:798)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.access$400(HintsInvoker.java:111)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.runAndAdd(HintsInvoker.java:657)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scanDoNotGoDeeper(HintsInvoker.java:711)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeSuggestions(HintsInvoker.java:396)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:232)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:209)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:182)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:149)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:114)
        at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:83)
        at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:298)
        at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:584)
        at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:809)
        at org.openide.util.lookup.Lookups.executeWith(Lookups.java:304)
        at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:725)
        at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:686)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1425)
        at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
        at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2038)
WARNING [org.netbeans.core.startup.InstalledFileLocatorImpl]: no code name base passed when looking up build_info at org.netbeans.modules.uihandler.BuildInfo.logBuildInfo(BuildInfo.java:84)
INFO [org.netbeans.modules.uihandler.Installer]: findIdentity: 5a5a3af5-f7ed-48a3-bcf4-4c78c8bde103_fe2fcf13-c9d7-481f-86a2-380583ec660d
Comment 1 Svata Dedic 2015-05-07 13:17:23 UTC
Confirmed. This is caused by the member reference.

The current code tries to resolve the member reference to an Element (trees.getElement(path)) and it "works" - the resulting Element is a METHOD kind, but its return type is UnknownType which fails serialization.

Please advise: is it OK, that e.g. 
* the Element is not an element which corresponds to java.util.Map.Entry.getKey() method ?
* trees.getTypeMirror() on the member reference yields error type (I would expect  executable type)

Is it possible to detect that such an Element is like "synthetic" (forged), so TPH is not created for it ?
Comment 2 Svata Dedic 2015-05-07 13:24:04 UTC
Reassigning to NB-javac for investigation. I can fix the handle if I can tell the Element is 'artificial' somehow - or the TPH.create() can be fixed by javac library returning a proper Element or return type :)
Comment 3 Svata Dedic 2015-06-02 07:58:50 UTC
Also see issue #236152, possibly a duplicate