Bug 99734 - [select] CodeSelect fails when selecting an anonymous class of Object
Summary: [select] CodeSelect fails when selecting an anonymous class of Object
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 12:56 EDT by David Audel CLA
Modified: 2005-09-20 11:29 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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