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.
This issue was originally marked as duplicate of issue 167554, that is already resolved. This issue is still valid, so this seems to be another issue, but it might be related. Build: NetBeans IDE Dev (Build 090929) VM: Java HotSpot(TM) Client VM, 14.1-b02, Java(TM) SE Runtime Environment, 1.6.0_15-b03 OS: Linux, 2.6.28-15-generic, i386 User Comments: jglick: Using JNA, trying to get code completion on Native.loadLibrary. Stacktrace: java.lang.AssertionError at org.netbeans.modules.javahints.StaticImport.hasMethodNameClash(StaticImport.java:322) at org.netbeans.modules.javahints.StaticImport.run(StaticImport.java:137) at org.netbeans.modules.java.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:125) at org.netbeans.modules.java.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:65) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:291) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:654)
Created attachment 88691 [details] stacktrace
Please have a look, thanks.
spec number bumped, so submitter should get an update in their plugin list and see the fix.
*** Issue 175251 has been marked as a duplicate of this issue. ***
Build: NetBeans IDE Dev (Build nbms-and-javadoc-4163-on-091024) VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01 OS: Windows XP, 5.1, x86 User Comments: Stacktrace: java.lang.AssertionError at org.netbeans.modules.javahints.StaticImport.hasMethodNameClash(StaticImport.java:322) at org.netbeans.modules.javahints.StaticImport.run(StaticImport.java:137) at org.netbeans.modules.java.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:125) at org.netbeans.modules.java.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:65) at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:291) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:654)
Created attachment 90297 [details] stacktrace
any chance you could upload the code snippet that caused this stacktrace? I see what is causing the assertion error, but I don't know why that code was called because the earlier call to getContainingClass should ensure that klass is, indeed, a CLASS.
Sorry, it's been weeks and there is no chance I have the original code fragment lying around. If you need this information, include the relevant parts in the assertion message. How is this FIXED? I don't see any changeset fixing it.
Any of class, enum, interface and annotation declaration map to Tree.Kind.CLASS. The corresponding element is ElementKind.CLASS/ENUM/INTERFACE/ANNOTATION, not only EK.CLASS, as hasMethodNameClash asserts. Code that causes this exception is e.g.: public enum E { A; public void aa() { Math.max(0, 1); } } or: public interface E { public void aa() { Math.max(0, 1); } } (not compilable, but code in the editor is very often not compilable.) Also: assert info.getTrees().getElement(<some-path>) != null may be too strong, IMO - although declarations should ideally always have an attached element, I do not think it is guaranteed to have one in practice (sometimes the source code is too broken for the error recovery).
http://hg.netbeans.org/main/contrib/rev/e592dd53f5c4