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

Bug 401401

Summary: if there is an line comment between the last import declaration and the Type declaration than the inspect of an variable from an imported Class is not possible
Product: [Eclipse Project] JDT Reporter: Roman Fischer <roman.fischer>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Roman Fischer CLA 2013-02-21 04:13:42 EST
if there is an line comment  between the last import declaration and the Type declaration than the inspect of a variable from an imported Class is not possible
-> "cannot be resolved to a Variable"

Solution:
In the Class org.eclipse.jdt.internal.debug.eval.ast.engine.SourceBasedSourceGenerator
in the methode isRightType would compare the SourceRange for evaluate the Return value. I think better is:   
return node instanceof AbstractTypeDeclaration 
         &&  fType.getElementName()
              .equals(((AbstractTypeDeclaration)node)
                           .getName()
                           .getIdentifier())
perhaps this is to simple?

see also the message from Thomas Guckenbiehl:
http://www.eclipse.org/forums/index.php/mv/msg/325767/839915/#msg_839915
Comment 1 Michael Rennie CLA 2013-03-06 09:20:44 EST
The underlying problem is the same as bug 329294. If I take the example from there (329294) and remove the line comments on the classes it works as expected.

Marking this as a dupe of 329294

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