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

Bug 340470

Summary: [implementation] Use ASTProvider.SHARED_AST_LEVEL instead of AST.JLS3 where it makes sense
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, deepakazad, markus.kell.r, Olivier_Thomann, raksha.vasisht
Version: 3.7   
Target Milestone: 3.7 M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Markus Keller CLA 2011-03-18 15:16:06 EDT
Created attachment 191542 [details]
Fix

HEAD

Use ASTProvider.SHARED_AST_LEVEL instead of AST.JLS3 where it makes sense.

The patch is based on Deepaks initial patch to use JLS4 in the BETA_JAVA7 branch, but it also includes test projects and is against HEAD.
Comment 1 Markus Keller CLA 2011-03-18 15:16:53 EDT
Fixed in HEAD.
Comment 2 Markus Keller CLA 2011-03-18 16:26:47 EDT
FYI: I've tagged BETA_JAVA7 of jdt.ui with v20110318-1550_BETA_JAVA7 and then I've thrown the switch in ASTProvider#SHARED_AST_LEVEL to use AST.JLS4.

New rules:

Normal jdt.ui code that just needs the latest AST level should always use ASTProvider.SHARED_AST_LEVEL.

Only backwards-compatibility code should refer to AST.JLS* (e.g. in case you need to check the level because you got the AST via an API and you need to test whether new JLS4 constructs are available or not). Such checks will usually use a lower bound, e.g. if (node.getAST().apiLevel() >= AST.JLS4) {...}.