Bug 7380

Summary: Wrong scope for traverse methods
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Dirk Baeumer CLA 2002-01-09 08:54:40 EST
The following ASTNodes have a wrong scope in their traverse methods:

- FieldDeclaration
- Initializer

both take a MethodScope but should take a ClassScope
Comment 1 Philipe Mulet CLA 2002-01-09 09:43:29 EST
Fields (and initializers) do not have their own scope, but rather share an 
intermediate initializer scope (static fields/initializers are grouped under a 
static initializer scope).
This extra scope is inserted in between the classscope and the 
field/initializer (for the latter the blockscope of the initializer block is a 
child of the initializer scope).

Initializer scope happen to be implemented as MethodScope, this is what you are 
seeing (but they answer true to #isInsideInitializer()).