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

Bug 85433

Summary: ClassNotLoadedException while performing completion on local variables in Display View
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: DebugAssignee: Darin Wright <darin.eclipse>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: david_audel
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Frederic Fusier CLA 2005-02-16 10:40:18 EST
Using 3.1 M5 candidate (I20040215-2300).

I've set a breakpoint in a method and want to perform some code snippet in
Display view. I begin to write my code (local variable name in my test case) in
this view and, as I'm a really lazy man, after 2 characters, I use code
completion to end the name of the local variable...

But with this build, doing this, I get a ClassNotLoadedException. In fact, as
soon as I start code completion (Ctrl+Space), I get this exception!

Set a critical as this is a regression on a basic functionality.
Comment 1 Frederic Fusier CLA 2005-02-16 10:47:21 EST
The exception does not occur only while performing code completion but also
while inspecting or running code in this view...

However, there's no problem in Variables view. Code assist, inspect and run work
perfectly.
Comment 2 Darin Wright CLA 2005-02-16 10:51:06 EST
Please specify test case.
Comment 3 Frederic Fusier CLA 2005-02-16 11:23:37 EST
It think it happens all the time whereever I have set a breakpoint.
But I can precise the scenario:

I was running ASTConverter15Test and put a breakpoint in test0140 method. I
tried to inspect typeBinding.isTopLevel() and had started to type "typ" and then
activated code completion => exception.

After that I've written the entire code by hand "typeBinding.isTopLevel()",
select it entirely and try to inspect it => exception.

Remove .isTopLevel() (ie. have only "typeBinding") in Display view, select it
and inspect => exception.

Empty all code in Display view and try to run code completion => exception.

However, nobodyelse in jdt.core team encounters this problem...!? I'll try a
reboot of my box...
Comment 4 Frederic Fusier CLA 2005-02-16 11:44:49 EST
After having investigated a little bit more, it appears that it only happens on
certain circumstances. So, a scenario was really necessary...

Using comment 3 scenario with ASTConverter15Test.test0140, we succeed to
reproduce the exception on several different boxes (even on Linux).
Comment 5 Frederic Fusier CLA 2005-02-16 11:46:06 EST
Decrease severity as it does not happen all the time...
Comment 6 David Audel CLA 2005-02-16 11:53:57 EST
The problem seems to occur only when ASTConverter15Test.test0140 is run alone.

To launch test0140 alone replace the suite() method by

public static Test suite() {
  if (false) {
    return new Suite(ASTConverter15Test.class);
  }
  TestSuite suite = new Suite(ASTConverter15Test.class.getName());
  suite.addTest(new ASTConverter15Test("test0140"));
  return suite;
}
Comment 7 Darin Wright CLA 2005-02-16 15:37:23 EST
M5 candidate
Comment 8 Luc Bourlier CLA 2005-02-17 15:50:58 EST
Fixed.
Added checks to manage ClassNotLoadedException.
This exception doesn't mean that something wrong happened, just that the state
of the VM is such that the referenced type is not yet loaded in the current
classloader.
This happens when an application has a complex classloader system, like Eclipse.

ASTEvaluationEngine, DisplayCompletionProcessor - local variables are now
ignored if their declaring type is not yet loaded.
Comment 9 Luc Bourlier CLA 2005-02-17 15:51:33 EST
Please verify, Darin W.
Comment 10 Darin Wright CLA 2005-02-17 18:01:16 EST
Verified.