Bug 27690

Summary: SourceElementParser doesn't parse local declarations even if it is requested
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Olivier Thomann CLA 2002-12-04 14:12:55 EST
Using 1203, I need to set needReferenceInfo to true to get the local
declarations. If needReferenceInfo is false, then even if I create a
SourceElementParser with reportLocalDeclarations set to true, I don't get them.
The bug seems to come from the parseCompilationUnit methods on SourceElementParser.
It parses the method bodies only if needReferenceInfo is true instead of
checking if localDeclarationVisitor is not null.
Comment 1 Philipe Mulet CLA 2002-12-05 08:51:06 EST
Pls fix
Comment 2 Olivier Thomann CLA 2002-12-05 09:12:26 EST
In fact it has to check both. The right test is:
localDeclarationVisitor != null || needReferenceInfo.
Because you might want to get the reference without the local declaration or
visa versa.
Comment 3 Olivier Thomann CLA 2002-12-05 12:17:53 EST
Fixed and released in 2.1 stream.
Comment 4 David Audel CLA 2002-12-18 04:26:16 EST
Verified.