Community
Participate
Working Groups
Created attachment 263499 [details] jdt.ui patch to start with - used for testing jdt.core Try Statement now supports variable references (effectively final vars) in addition to LocalVariableDeclaration - see bug 497719 for details Attached is the jdt.ui patch used for testing jdt.core (if it helps)
Manoj, please provide more details on what jdt.ui support is expected here to support final / effectively final variables in try-with-resources.
(In reply to Noopur Gupta from comment #1) > Manoj, please provide more details on what jdt.ui support is expected here > to support final / effectively final variables in try-with-resources. Please see the attachment for the change - the level change is required (this is a generic change when you move to 9 - not specific to twr).
(In reply to Manoj Palat from comment #2) > (In reply to Noopur Gupta from comment #1) > > Manoj, please provide more details on what jdt.ui support is expected here > > to support final / effectively final variables in try-with-resources. > > Please see the attachment for the change - the level change is required > (this is a generic change when you move to 9 - not specific to twr). The attachment updates the following: - ASTProvider#SHARED_AST_LEVEL to AST.JLS9 - ASTView#JLS_LATEST to AST.JLS9 We will move to AST.JLS9 after adapting the jdt.ui code to relevant changes in the new AST level. This should not block support for final / effectively final variables in try-with-resources. Updating the bug summary to reflect the same.
See bug 496123 comment #8 also.
The following commit updated ASTView#JLS_LATEST to AST.JLS9: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?h=BETA_JAVA9&id=54e95829ba25f3e8f8db347f33f9b866f03debae Markus, are you planning to provide the fix for moving ASTProvider#SHARED_AST_LEVEL to AST.JLS9 also?
Sorry, I won't get to this in 2016. Noopur, feel free to work on this, but remember that throwing the switch makes you responsible for fixing all client code and tests that will be affected by the change. Client code is currently a bit hard to find, because a search for references to ASTNode#unsupportedBelow9() doesn't find all new APIs (bug 496123 comment 10). We usually only commit the switch once the AST is near-final form, since every further change in the AST will immediately break JDT UI.
I'll wait for the near-final form of AST before starting any work on this.
Pushed a first change in preparation for this bug: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=117f612d080d828a1c80929ac797661b0556b99a See https://wiki.eclipse.org/JDT_UI/Java8#Things_to_remember.2Fcaveats ff. for a list of things we did for Java 8.
New Gerrit change created: https://git.eclipse.org/r/100173
Second batch of changes: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=cb0d2577b0cc2bc071ac804db7daba6012036b34
Updated references to resources in TryStatement and released: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?h=BETA_JAVA9&id=b80c9b62a1467f54883084da2325f6b52db0943c
(In reply to Noopur Gupta from comment #11) > Updated references to resources in TryStatement and released: Note that many of those changes break functionality as long as IASTSharedValues#SHARED_AST_LEVEL is still at JLS8. The changes I pushed before were all safe for JLS8 and JLS9 ASTs. If you think we're ready to throw the global switch to JLS9, then please throw it.
Switched the AST level to JLS9: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?h=BETA_JAVA9&id=f2f8822391ea5d45a57daba73a196052aacd9d68