Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340470 - [implementation] Use ASTProvider.SHARED_AST_LEVEL instead of AST.JLS3 where it makes sense
Summary: [implementation] Use ASTProvider.SHARED_AST_LEVEL instead of AST.JLS3 where i...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-18 15:16 EDT by Markus Keller CLA
Modified: 2011-03-18 16:26 EDT (History)
5 users (show)

See Also:


Attachments
Fix (142.83 KB, patch)
2011-03-18 15:16 EDT, Markus Keller CLA
no flags Details | Diff

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