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.
Summary: | IllegalArgumentException: Unsupported type: <any?>, kind: OTHER | ||
---|---|---|---|
Product: | java | Reporter: | theshadow27 <theshadow27> |
Component: | Navigation | Assignee: | Tomas Zezula <tzezula> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | abien, alexvsimon, everflux, gtzabari, hmichel, jan.kurnatowski, jbosboom, jglick, jiriprox, KevinAnderson, Leperous, lolo_101, muellermi, NwDx, petrk, ppisl, swpalmer, terje7601, theshadow27, vv159170, wshackle |
Priority: | P1 | ||
Version: | 7.4 | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://netbeans.org/bugzilla/show_bug.cgi?id=236155 https://netbeans.org/bugzilla/show_bug.cgi?id=235620 |
||
Issue Type: | DEFECT | Exception Reporter: | 204007 |
Attachments: |
stacktrace
stacktrace stacktrace testcase: Issue235620.java stacktrace stacktrace stacktrace stacktrace testcase for new bug: Issue236152.java testcase: Issue 236152_2.java with stack trace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace Class unresolvable on given classpath |
Description
theshadow27
2013-09-19 14:54:24 UTC
Created attachment 140256 [details]
stacktrace
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. Created attachment 140258 [details]
stacktrace
Showing that it is repeatable
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 This bug already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=204007 Created attachment 148686 [details]
stacktrace
Trouble with lambda code completion
Fixed jet-main a7b71995b49f 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. 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. I see. Thanks for following up. Please extract new reports in separate bug. 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.
(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 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. Created attachment 153133 [details]
stacktrace
edit java source
Created attachment 153177 [details]
stacktrace
Not sure.
This bug already has 100 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=204007 Was able to reproduce via simple testcases, see attachment Created attachment 153237 [details]
testcase for new bug: Issue236152.java
> Created attachment 153237 [details]
> testcase for new bug: Issue236152.java
Sorry, that is in dev 201504140001
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.
Created attachment 153829 [details]
stacktrace
invoced code completion
Created attachment 153830 [details]
stacktrace
code completion at this position
-> System.out::
Created attachment 153906 [details]
stacktrace
Editing a non compilable code:
collection.stream().map(SomeClass::getValue).reduce(TEN, null, null)BigDecimal::add);
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) (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. 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
Created attachment 154292 [details]
stacktrace
edit class
Created attachment 154293 [details]
stacktrace
edit class
Created attachment 154409 [details]
stacktrace
IAE when pasting fragment of code
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. Fixed 3) jet-main 225ddfb55a37 (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. 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. 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.
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 :) Added comments: jet-main 5ffc38fccd67 Fixed 1) and 2) jet-main 6febe2f40288 Fixed case 4). jet-main 1d6a85713dd1. 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. 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 |