Bug 104877

Summary: [1.5] TypeDeclarationStatement should use DECLARATION_PROPERTY in JLS3 API
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jim des Rivieres <jeem>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.1   
Target Milestone: 3.2 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2005-07-22 16:00:34 EDT
N20050722-0010

The "declaration" property of a TypeDeclarationStatement has the wrong
getLocationInParent() in JLS3 API.
Expected: DECLARATION_PROPERTY
Is: TYPE_DECLARATION_PROPERTY

This manifests e.g. in the ASTView's inability to focus on a local type:
- have this class in a 5.0 project (JLS3 AST):
class Outer {
	void m() {
		class Local {}
	}
}

- select 'Local'
- open ASTView and press F5
-> tree doesn't expand to selection (since it compares getLocationInParent())
Comment 1 Jim des Rivieres CLA 2005-07-23 14:04:26 EDT
Fixed in builds > N20050723. Improved tests; updated build notes.
Comment 2 Olivier Thomann CLA 2005-08-09 10:50:56 EDT
F5 doesn't work, but debugging the code seems to show the right location.
Verified in 3.2M1 (I20050808-2000)
Comment 3 Markus Keller CLA 2005-08-09 11:06:41 EDT
Works for me too. F5 should be bound to the retargetable 'Refresh' action by
default and execute 'Show AST of active editor' in the ASTView. However, this
may not work if you're in a debugging session and debug has stolen F5 for 'Step
Into'.