Bug 99734

Summary: [select] CodeSelect fails when selecting an anonymous class of Object
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.2 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Audel CLA 2005-06-13 12:56:54 EDT
build 3.1RC1
1) create X.java
class X {
  void foo() {
    new Object(){};
  }
}
2) select Object
3) do F3

Object.class is open but the cursor is at beginning of the file.
Comment 1 David Audel CLA 2005-06-13 13:01:57 EDT
The default constructor doesn't exist in the attached source file.
IMethod#getSourceRange return [offset=-1, length =0].

In this case CodeSelect should return the declaring type of the IMethod instead
of the IMethod.
Comment 2 David Audel CLA 2005-09-07 06:55:58 EDT
Fixed and test added
  ResolveTests#testConstructor2()
Test updated
  ResolveTests#testConstructorCallOfMemberType()

If the selected method is a binary constructor that does not exist in the
attached source then the the declaring type is returned.
Comment 3 Olivier Thomann CLA 2005-09-20 11:29:52 EDT
Verified in I20050920-0010 for 3.2M2