Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343304

Summary: In "Display view", the code complete sometimes works, sometimes not.
Product: [Eclipse Project] JDT Reporter: Napu Sun <sunnapu>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, evan_hughes, Michael_Rennie, remy.suen, sunnapu
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Napu Sun CLA 2011-04-19 15:01:38 EDT
You can use the following code to replicate the problem:

//----------------------------------
public class ShowProblem {
	public static void main(String[] args) {
		ShowProblem testProblem = new ShowProblem();
		testProblem.replicateProblem();
	}

	private void replicateProblem() {
		getClass()	//Set the first breakpoint at this line
		.getClassLoader()
		.getResourceAsStream(
		"report/jasperReport.jasper");
		
		ForTest print=null;
		
		getClass() //Set the second breakpoint at this line
		.getClassLoader()
		.getResourceAsStream(
		"report/jasperReport.jasper");
	}
}

class ForTest {
	
}
//------------------------------------------------

In "Display" view, at the first breakpoint, the code completion works. But when reaching to the second breakpoint, the code completion doesn't work. 

Thanks for looking at this.
Comment 1 Evan Hughes CLA 2011-08-29 14:25:24 EDT
I believe this is a dupe of bug 215142.
Comment 2 Michael Rennie CLA 2011-08-29 16:49:44 EDT
(In reply to comment #1)
> I believe this is a dupe of bug 215142.

It appears that way, but without a stack trace its hard to say. Napu, do you have any entries in your error log? any error dialogs popping up?
Comment 3 Michael Rennie CLA 2011-08-29 16:58:37 EDT
(In reply to comment #2)

> It appears that way, but without a stack trace its hard to say. 

Looks like a dupe indeed:

org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving type of local variable.
	at org.eclipse.jdt.internal.debug.core.model.JDIDebugElement.throwDebugException(JDIDebugElement.java:214)
	at org.eclipse.jdt.internal.debug.core.model.JDIDebugElement.targetRequestFailed(JDIDebugElement.java:180)
	at org.eclipse.jdt.internal.debug.core.model.JDILocalVariable.getUnderlyingType(JDILocalVariable.java:186)
	at org.eclipse.jdt.internal.debug.core.model.JDIVariable.getJavaType(JDIVariable.java:202)
	at org.eclipse.jdt.internal.debug.ui.contentassist.CurrentFrameContext.getLocalVariables(CurrentFrameContext.java:67)
	at org.eclipse.jdt.internal.debug.ui.contentassist.JavaDebugContentAssistProcessor.computeCompletionProposals(JavaDebugContentAssistProcessor.java:125)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1830)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:488)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1656)
	at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:930)
	at org.eclipse.jdt.internal.debug.ui.display.DisplayViewAction.run(DisplayViewAction.java:51)
	at org.eclipse.jdt.internal.debug.ui.display.DisplayView$3.execute(DisplayView.java:287)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1509)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2532)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: com.sun.jdi.ClassNotLoadedException: Type has not been loaded
	at org.eclipse.jdi.internal.ReferenceTypeImpl.create(ReferenceTypeImpl.java:1285)
	at org.eclipse.jdi.internal.TypeImpl.create(TypeImpl.java:64)
	at org.eclipse.jdi.internal.LocalVariableImpl.type(LocalVariableImpl.java:166)
	at org.eclipse.jdt.internal.debug.core.model.JDILocalVariable.getUnderlyingType(JDILocalVariable.java:184)

*** This bug has been marked as a duplicate of bug 215142 ***