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 236152 - IllegalArgumentException: Unsupported type: <any?>, kind: OTHER
Summary: IllegalArgumentException: Unsupported type: <any?>, kind: OTHER
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 7.4
Hardware: All All
: P1 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-19 14:54 UTC by theshadow27
Modified: 2015-07-15 01:20 UTC (History)
21 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 204007


Attachments
stacktrace (1.40 KB, text/plain)
2013-09-19 14:54 UTC, theshadow27
Details
stacktrace (3.32 KB, text/plain)
2013-09-19 14:57 UTC, theshadow27
Details
stacktrace (3.32 KB, text/plain)
2013-09-19 15:00 UTC, theshadow27
Details
testcase: Issue235620.java (1.50 KB, text/plain)
2013-09-26 13:36 UTC, theshadow27
Details
stacktrace (2.94 KB, text/plain)
2014-08-13 14:01 UTC, abien
Details
stacktrace (4.99 KB, text/plain)
2015-04-09 21:36 UTC, swpalmer
Details
stacktrace (1.71 KB, text/plain)
2015-04-10 21:06 UTC, muellermi
Details
stacktrace (3.06 KB, text/plain)
2015-04-13 21:13 UTC, Jesse Glick
Details
testcase for new bug: Issue236152.java (577 bytes, text/x-java)
2015-04-16 16:58 UTC, theshadow27
Details
testcase: Issue 236152_2.java with stack trace (17.68 KB, text/plain)
2015-04-16 20:50 UTC, theshadow27
Details
stacktrace (3.35 KB, text/plain)
2015-05-23 17:39 UTC, everflux
Details
stacktrace (3.00 KB, text/plain)
2015-05-23 18:09 UTC, everflux
Details
stacktrace (5.10 KB, text/plain)
2015-05-27 16:25 UTC, Michel Graciano
Details
stacktrace (5.11 KB, text/plain)
2015-05-29 20:04 UTC, Vladimir Voskresensky
Details
stacktrace (3.35 KB, text/plain)
2015-06-19 01:55 UTC, Alexander Simon
Details
stacktrace (3.35 KB, text/plain)
2015-06-19 02:07 UTC, Alexander Simon
Details
stacktrace (3.35 KB, text/plain)
2015-06-26 21:23 UTC, Jiri Prox
Details
Class unresolvable on given classpath (8.69 KB, image/png)
2015-07-13 20:54 UTC, Tomas Zezula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description theshadow27 2013-09-19 14:54:24 UTC
Build: NetBeans IDE Dev (Build 201309180002)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.25-b01, Java(TM) SE Runtime Environment, 1.7.0_25-b15
OS: Mac OS X

User Comments:
theshadow27: Clicked in the editor window. Probably related to bug 235620




Stacktrace: 
java.lang.IllegalArgumentException: Unsupported type: <any?>, kind: OTHER
   at org.netbeans.modules.java.source.usages.ClassFileUtil.encodeType(ClassFileUtil.java:319)
   at org.netbeans.modules.java.source.usages.ClassFileUtil.createExecutableDescriptor(ClassFileUtil.java:209)
   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.modules.java.navigation.CaretListeningTask.updateNavigatorSelection(CaretListeningTask.java:270)
   at org.netbeans.modules.java.navigation.CaretListeningTask.run(CaretListeningTask.java:146)
Comment 1 theshadow27 2013-09-19 14:54:27 UTC
Created attachment 140256 [details]
stacktrace
Comment 2 theshadow27 2013-09-19 14:57:13 UTC
Created attachment 140257 [details]
stacktrace

Repeatable in dev 130918- after pasting the code described in bug 235620, and submitting the exception report via the Report Problem dialog, I can trigger this bug many times just by clicking in the pasted code. Workaround: save the file. 

Also, hints are lost until the file is saved.
Comment 3 theshadow27 2013-09-19 15:00:10 UTC
Created attachment 140258 [details]
stacktrace

Showing that it is repeatable
Comment 4 theshadow27 2013-09-26 13:36:35 UTC
Created attachment 140510 [details]
testcase: Issue235620.java

Same testcase from bug 235620, step 5 produces this exception. Steps to reproduce:

 1) in the testSomething() method, highlight the code between the two comments
 2) Copy the highlighted code using ctrl+c
 3) Place cursor in the testSomethingElse() method between the two comments
 4) Paste the copied code using ctrl+v.
 5) then click inside the pasted method. This will trigger the IllegalArgumentException from bug 236152
Comment 5 Exceptions Reporter 2014-08-06 12:37:47 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=204007
Comment 6 abien 2014-08-13 14:01:49 UTC
Created attachment 148686 [details]
stacktrace

Trouble with lambda code completion
Comment 7 Tomas Zezula 2014-08-19 12:41:06 UTC
Fixed jet-main a7b71995b49f
Comment 8 terje7601 2015-03-26 14:27:59 UTC
Is this bug fix available in the daily dev builds already? If not, can this be done please? There have been plenty of new exception reports for this bug since it was marked as fixed in August last year.
Comment 9 Tomas Zezula 2015-03-26 14:35:17 UTC
The new reports are several problems which were wrongly assigned to this bug report.
I will need to split the reports and assign to proper sub components.
Comment 10 terje7601 2015-03-27 07:38:29 UTC
I see. Thanks for following up.
Comment 11 Alexander Simon 2015-04-09 15:19:22 UTC
Please extract new reports in separate bug.
Comment 12 swpalmer 2015-04-09 21:36:30 UTC
Created attachment 153118 [details]
stacktrace

Editing Java code.  I'm converting from C++ code, so I pasted code c++ code into a Java file, therefore I have a lot of syntax errors. I am working on making it proper Java code and there are frequent stalls and occasionally an exception.
Comment 13 theshadow27 2015-04-09 21:55:41 UTC
(In reply to Tomas Zezula from comment #9)
> The new reports are several problems which were wrongly assigned to this bug
> report.
> I will need to split the reports and assign to proper sub components.

Please also review bug 236155 which I filed as related to this original issue (in the 'see also, above') - the exception still occurs in jet-main as of 8.0.2 but the stack trace there has changed too. It now originates from  org.netbeans.modules.java.source.PostFlowAnalysis by com.sun.tools.javac.tree.TreeScanner; the original bug was in com.sun.tools.javac.comp.Resolve via com.sun.tools.javac.comp.Attr
Comment 14 Tomas Zezula 2015-04-10 16:51:46 UTC
I will split the issue.

The problem is that exception reported takes 5 top level stack frames to assign the bug or mark as duplicate. Even I spent a day to split it next issues will be duplicated here.
Comment 15 muellermi 2015-04-10 21:06:41 UTC
Created attachment 153133 [details]
stacktrace

edit java source
Comment 16 Jesse Glick 2015-04-13 21:13:11 UTC
Created attachment 153177 [details]
stacktrace

Not sure.
Comment 17 Exceptions Reporter 2015-04-13 21:13:16 UTC
This bug already has 100 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=204007
Comment 18 theshadow27 2015-04-16 16:58:13 UTC
Was able to reproduce via simple testcases, see attachment
Comment 19 theshadow27 2015-04-16 16:58:19 UTC
Created attachment 153237 [details]
testcase for new bug: Issue236152.java
Comment 20 theshadow27 2015-04-16 16:59:25 UTC
> Created attachment 153237 [details]
> testcase for new bug: Issue236152.java

Sorry, that is in dev 201504140001
Comment 21 theshadow27 2015-04-16 20:50:31 UTC
Created attachment 153242 [details]
testcase: Issue 236152_2.java with stack trace

There are several different exceptions being thrown that all look like similar stack trace (at least at the beginning), I have test case that throws two of them, there may be more in my other test case. To keep the stacktrace(s) with the test case I put them in the same file.
Comment 22 everflux 2015-05-23 17:39:46 UTC
Created attachment 153829 [details]
stacktrace

invoced code completion
Comment 23 everflux 2015-05-23 18:09:47 UTC
Created attachment 153830 [details]
stacktrace

code completion at this position
-> System.out::
Comment 24 Michel Graciano 2015-05-27 16:25:27 UTC
Created attachment 153906 [details]
stacktrace

Editing a non compilable code:

collection.stream().map(SomeClass::getValue).reduce(TEN, null, null)BigDecimal::add);
Comment 25 Michel Graciano 2015-05-27 16:27:21 UTC
I have not faced it at 8.0.2 but I am facing it consistently at daily builds.

Product Version: NetBeans IDE Dev (Build 20150526-8c1aa2166361)
Java: 1.8.0_05; Java HotSpot(TM) 64-Bit Server VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.4.63-2.44-desktop running on amd64; UTF-8; en_US (nb)
Comment 26 Michel Graciano 2015-05-27 16:29:17 UTC
(In reply to Michel Graciano from comment #25)
> I have not faced it at 8.0.2 but I am facing it consistently at daily builds.
> 
> Product Version: NetBeans IDE Dev (Build 20150526-8c1aa2166361)
> Java: 1.8.0_05; Java HotSpot(TM) 64-Bit Server VM 25.5-b02
> Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
> System: Linux version 3.4.63-2.44-desktop running on amd64; UTF-8; en_US (nb)

Code reproducing the issue:

collection.stream().map(SomeClass::getValue).reduce(TEN, null, null)BigDecimal::add);

If I remove 'BigDecimal::add' from the code the exception goes away.
Comment 27 Vladimir Voskresensky 2015-05-29 20:04:44 UTC
Created attachment 153960 [details]
stacktrace

in Java file  inserted C++ code like
#ifdef LLVM_ON_WIN32
       rootName = path::has_root_name(p);
#else
       rootName = true;
#endif
Comment 28 Alexander Simon 2015-06-19 01:55:37 UTC
Created attachment 154292 [details]
stacktrace

edit class
Comment 29 Alexander Simon 2015-06-19 02:07:37 UTC
Created attachment 154293 [details]
stacktrace

edit class
Comment 30 Jiri Prox 2015-06-26 21:23:46 UTC
Created attachment 154409 [details]
stacktrace

IAE when pasting fragment of code
Comment 31 Tomas Zezula 2015-07-13 16:54:06 UTC
Basically 4 types ordered by count:

1st)BreadCrumbs - java/navigation
2nd) Lambda$MemberReference2Lambda - java/hints
3rd) CaretListeingTask - java/navigation
4th) org.netbeans.modules.java.editor.overridden.IsOverriddenVisitor - java/editor


1st + 3rd covered by this issue.
Comment 32 Tomas Zezula 2015-07-13 20:25:11 UTC
Fixed 3) jet-main 225ddfb55a37
Comment 33 theshadow27 2015-07-13 20:37:02 UTC
(In reply to Tomas Zezula from comment #32)
> Fixed 3) jet-main 225ddfb55a37

Sorry for a silly question... with this commit:

    2.19 +        if (element.getKind() == ElementKind.OTHER) {
    2.20 +            return null;
    2.21 +        }
    2.22 +        try {
    2.23 +            return ElementHandle.create(element);
    2.24 +        } catch (IllegalArgumentException e) {
    2.25 +            return null;
    2.26 +        }

Does this really fix the problem? What if there are other bad kinds of elements, the logs will never show it.
Comment 34 Tomas Zezula 2015-07-13 20:45:26 UTC
The element.getKind() returns CLASS, INTERFACE, ENUM, ANNOTATION_TYPE, METHOD, etc for valid Java Model Elements. The special kin OTHER represents errors <any?>, <none>. These are special errors which cannot be resolve unlike those which are invalid in given classpath but can be resolved as ClassSymbol(CLASS,"org.me.Foo") which has kind CLASS, unresolvable fqn "org.me.Foo" and ErrorType on given ClassPath.
The <any>,<none> are completely unresolvable in given source level.
Comment 35 Tomas Zezula 2015-07-13 20:54:45 UTC
Created attachment 154599 [details]
Class unresolvable on given classpath

Added an screenshot of class unresolvable on given classpath which is valid Element {FIELD, "org.me.Foo"} but ErrorType compared to Element {OTHER, ""} which is also ErrorType but it's invalid.
Comment 36 _ gtzabari 2015-07-13 20:58:15 UTC
I suggest adding a code comment containing a brief version of comment 34 so the next person who stumbles upon this code will understand what's going on :)
Comment 37 Tomas Zezula 2015-07-14 06:12:53 UTC
Added comments: jet-main 5ffc38fccd67
Comment 38 Tomas Zezula 2015-07-14 08:12:45 UTC
Fixed 1) and 2)
jet-main 6febe2f40288
Comment 39 Tomas Zezula 2015-07-14 08:49:14 UTC
Fixed case 4).
jet-main 1d6a85713dd1.
Comment 40 Tomas Zezula 2015-07-14 08:50:53 UTC
Fixed all four cases from the 50+ most recent reports.
There may be other different cases in the older reports but if they are still valid they will become reported.
Comment 41 Quality Engineering 2015-07-15 01:20:15 UTC
Integrated into 'main-silver', will be available in build *201507150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5ffc38fccd67
User: Tomas Zezula <tzezula@netbeans.org>
Log: #236152:IllegalArgumentException: Unsupported type: <any?>, kind: OTHER