Bug 7380 - Wrong scope for traverse methods
Summary: Wrong scope for traverse methods
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-09 08:54 EST by Dirk Baeumer CLA
Modified: 2002-01-11 08:57 EST (History)
0 users

See Also:


Attachments

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