Community
Participate
Working Groups
Build ID: I20070621-1340 Steps To Reproduce: Using this code ==== public class Test { static { <> } } ==== Try autocomplete within the <> area. The NPE will be thrown. More information: This was first found in eclipse 3.2 and reproducible in 3.3.
Sorry, I cannot reproduce this using plain Eclipse SDK.
I also tested with this build on another machine Version: 3.2.2 Build id: M20070212-1330 with a static block static{<>} and then try auto-completing, ie ctrl-space within the angle brackets. Here's the top of the stack trace: !ENTRY org.eclipse.jdt.ui 2 0 2007-07-19 17:34:43.006 !MESSAGE The 'org.eclipse.jdt.ui.JavaNoTypeCompletionProposalComputer' proposal computer from the 'org.eclipse.jdt.ui' plug-in did not complete normally. The extension has thrown a runtime exception. !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.buildMoreGenericsCompletionContext(CompletionParser.java:878) at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.attachOrphanCompletionNode(CompletionParser.java:399) at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.updateRecoveryState(CompletionParser.java:3794) at org.eclipse.jdt.internal.compiler.parser.Parser.resumeOnSyntaxError(Parser.java:9915)
Sorry but not here. Either your test case is not complete or you are not using plain Eclipse SDK. 1. download Eclipse SDK (I tested R3.2.2. R3.3 and latest I-build) and install into an empty directory 2. start with new workspace 3. paste the following into Package Explorer: public class Test { static { <> } } 4. replace <> with the caret 5. Ctrl+Space ==> no exception. Please provide more details. Moving to JDT Core as the exception happens there.
I can reproduce the problem with this test case public class Test { static { <|> // do ctrl+space at | location } }
>I can reproduce the problem with this test case Me too ;-) I replaced <> with the caret instead of doing code assist with <>.
Created attachment 74671 [details] Proposed fix
Released for 3.4M1. Tests added GenericsCompletionParserTest#test0214_Diet() GenericsCompletionParserTest#test0214_Method()
Verified for 3.4M1 using build I20070802-0800.