Community
Participate
Working Groups
I20060315-1200 Not sure whether the NPE is JDT Core or in client code (i.e. calling JDT Core API with wrong arguments). Test Case: 1. have this: public class CharTest { public static void main(String[] args) { char[] c= new char[] { '\n', '\t', '\r' }; String s= "foo \n bar \t\r"; /* add breakpoint on this line */ s= s.toString(); c.toString(); } } 2. add breakpoint where indicated and start debugger. 3. select "args" in the Veriables view 4. press Ctrl+Space ==> Error dialog plus .log entry: java.lang.NullPointerException at org.eclipse.jdt.internal.codeassist.CompletionEngine.findLocalMethods(CompletionEngine.java:3997) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findMethods(CompletionEngine.java:4699) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findVariablesAndMethods(CompletionEngine.java:5568) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:789) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1485) at org.eclipse.jdt.internal.core.BinaryType.codeComplete(BinaryType.java:113) at org.eclipse.jdt.internal.core.BinaryType.codeComplete(BinaryType.java:82) at org.eclipse.jdt.internal.debug.ui.contentassist.JavaDebugContentAssistProcessor.computeCompletionProposals(JavaDebugContentAssistProcessor.java:136) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1568) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:447) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$15(CompletionProposalPopup.java:444) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:379) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:373) at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1417) at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:777) at org.eclipse.ui.console.actions.TextViewerAction.run(TextViewerAction.java:68) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:460) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:424) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:160) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:466) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:799) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:846) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:564) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:506) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:122) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:982) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:924) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:949) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:934) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:962) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:958) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1272) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3343) at org.eclipse.swt.widgets.Tree.WM_CHAR(Tree.java:4423) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3243) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:4419) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4017) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1878) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2958) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1909) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1873) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:418) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:107) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:374) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
This bug disappear with the fix for bug 132813.
*** This bug has been marked as a duplicate of 132813 ***
The bug can only be reproduced in 1.5. Added SnippetCompletionTests_1_5#testCodeSnippetAssistForBug132665 Even with the fix for bug 132813 the behavior isn't perfect because the method 'getClass()' isn't proposed (foo2 isn't proposed in testCodeSnippetAssistForBug132665()). I enter a new bug report (bug 133005) because this is not the same bug as the NPE.