Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 234023

Summary: Tag scanner does not respect source level
Product: [Eclipse Project] PDE Reporter: Michael Rennie <Michael_Rennie>
Component: API ToolsAssignee: Darin Wright <darin.eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: darin.eclipse, Olivier_Thomann
Version: 3.4   
Target Milestone: 3.5 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 232404    
Attachments:
Description Flags
patch
none
updated patch
none
updated patch 2 none

Description Michael Rennie CLA 2008-05-26 16:16:31 EDT
Currently when our tag scanner creates a new AST parser we do not set the correct source level (it defaults to 1.4 compliance). In the cases when we have an ICompilationUnit to scan (in the IDE) we can get the options to use. In the headless world (the ant task) we should ask the API profile for its bound EE and derive the compliance level from that.

As it stands, currently we do not respect restriction settings in any code with a compliance level of 1.5 or greater.
Comment 1 Michael Rennie CLA 2008-05-26 21:47:27 EDT
Created attachment 102084 [details]
patch

we can use an ICompilationUnit to get the settings we need in the IDE world,  but in the ant task (headless) world we need to derive it. Since we don't have an EE context, we can use the related compliance level that would map to the EE returned from our Util.getDefaultEEId() (defaults to a compliance of 1.6).
Comment 2 Darin Wright CLA 2008-05-27 13:20:40 EDT
In the Ant task, I think it would be safer to use the BREE ("Bundle-RequiredExecutionEnvironment:" header) from the MANIFEST.MF as a guide for source level options.
Comment 3 Michael Rennie CLA 2008-06-09 12:59:29 EDT
Created attachment 104190 [details]
updated patch

Updated patch to use the BREE to try and resolve a compiler compliance level in the ant task
Comment 4 Olivier Thomann CLA 2008-06-10 14:15:48 EDT
The patch doesn't seem to support CLDC or Foundation EEs.
Comment 5 Michael Rennie CLA 2008-06-10 15:11:05 EDT
Created attachment 104371 [details]
updated patch 2

further update to default to lower compliance, which covers CLDC / Foundation EE's
Comment 6 Michael Rennie CLA 2008-06-18 15:12:40 EDT
fixed in HEAD
Comment 7 Michael Rennie CLA 2008-06-18 15:13:09 EDT
please verify Darin W
Comment 8 Darin Wright CLA 2008-06-20 13:00:40 EDT
Verified, but filed bug 237961 to deal with custom EE's and understanding how to map them to a compliance level.