Skip to main content
Jump to: navigation, search

Difference between revisions of "JDT Core/Java7"

 
(35 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
This page will summarize all the work that is done to add Java(tm) 7 support (jsr334: project coin) into Eclipse. It might also be extended to other jsrs if needed. We still need to find out what changes are supposed to be done to support the jsr 292 in the compiler. This is not clear yet.<br>  
 
This page will summarize all the work that is done to add Java(tm) 7 support (jsr334: project coin) into Eclipse. It might also be extended to other jsrs if needed. We still need to find out what changes are supposed to be done to support the jsr 292 in the compiler. This is not clear yet.<br>  
  
= Current Status =
+
= Current Status at the first glance =
  
 
<br>  
 
<br>  
Line 8: Line 8:
 
|+ '''Java 7 features'''  
 
|+ '''Java 7 features'''  
 
|-
 
|-
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | [[Switch on Strings]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Switch on Strings  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | [[Binary Literals]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Binary Literals  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | [[Underscores in Literals]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Underscores in Literals  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | [[Multi-catch]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Multi-catch  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | [[More Precise Rethrow]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | More Precise Rethrow
 
|-
 
|-
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | [[Try-with-Resources]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Try-with-Resources  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | [[Simplified Varargs Method Invocation]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Simplified Varargs Method Invocation
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(242, 206, 206);" | [[Diamond]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Diamond  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | [[Polymorphic Methods]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Polymorphic Methods  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | [[Unicode 6.0]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Unicode 6.0
 
|-
 
|-
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 206, 242);" | [[Update Indexing]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Update Indexing  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 206, 242);" | [[Update Code Formatter]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Update Code Formatter  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 206, 242);" | [[Update DOM/AST]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Update DOM/AST  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 206, 242);" | [[Update Search]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 242, 206);" | Update Search  
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(242, 206, 206);" | [[Update Error Recovery]]
+
! width="200" align="center" style="background: none repeat scroll 0% 0% rgb(206, 206, 242);" | Update Error Recovery
 
|}
 
|}
  
Line 35: Line 35:
 
|-
 
|-
 
! style="background: none repeat scroll 0% 0% rgb(206, 206, 242);" | <br>  
 
! style="background: none repeat scroll 0% 0% rgb(206, 206, 242);" | <br>  
| Partially implemented or "can be improved"
+
| Can be improved
|-
+
! style="background: none repeat scroll 0% 0% rgb(242, 206, 206);" | <br>
+
| Not implemented
+
 
|}
 
|}
  
Line 45: Line 42:
 
*Add new nodes inside the compiler ast to cover:<br>
 
*Add new nodes inside the compiler ast to cover:<br>
  
#Multi catch formal parameter ("catch( Ex1 | Ex2 | Ex3 e) {...").<br>The new class is named: org.eclipse.jdt.internal.compiler.ast.DisjunctiveTypeReference<br>
+
#Multi catch formal parameter ("catch( Ex1 | Ex2 | Ex3 e) {...").<br>The new class is named: ''org.eclipse.jdt.internal.compiler.ast.UnionTypeReference''<br>
  
 
*The grammar has been updated to cover the new syntax for multi-catch, try-with-resources and diamond case.<br>  
 
*The grammar has been updated to cover the new syntax for multi-catch, try-with-resources and diamond case.<br>  
*A new DOM/AST node have been added for the disjunctive type.<br>The new class is: org.eclipse.jdt.core.dom.DisjunctiveType<br>  
+
*A new DOM/AST node have been added for the union type. The new class is: ''org.eclipse.jdt.core.dom.UnionType''<br>  
*A new DOM/AST node have been added for the try with resources statement.<br>The new class is: org.eclipse.jdt.core.dom.TryStatementWithResources<br>  
+
*The class ''org.eclipse.jdt.core.dom.TryStatement'' has been updated to support the new Try-with-Resources statement.<br>  
*Two new constants have been added for the DOM nodes. There are the constants for the node type:<br>&nbsp;&nbsp; org.eclipse.jdt.core.dom.ASTNode#DISJUNCTIVE_TYPE,<br>&nbsp;&nbsp; org.eclipse.jdt.core.dom.ASTNode#TRY_STATEMENT_WITH_RESOURCES<br>  
+
*Two new constants have been added for the DOM nodes. There are the constants for the node type:<br>&nbsp;&nbsp; org.eclipse.jdt.core.dom.ASTNode#UNION_TYPE<br>  
*Experimental handling of java.dyn.MethodHandle.invokeExact(..)/invokeGeneric(..)  
+
*Experimental handling of java.dyn.MethodHandle.invokeExact(..)/invoke(..) (invokeGeneric(..) is now deprecated)<br>
*A new constant has been added for the JLS (JLS4) level in the org.eclipse.jdt.core.dom.AST class.<br>This constant is needed for the new DOM/AST node to be created.<br>
+
*A new constant has been added for the JLS (JLS4) level in the org.eclipse.jdt.core.dom.AST class.<br>This constant is needed for the new DOM/AST nodes to be created.<br>
 +
*Content assist support for switch in strings, try with resources, multi-catch exceptions.
  
 
<br>
 
<br>
  
= Work complete<br>  =
+
= Work complete =
  
 
*Support for switch on strings  
 
*Support for switch on strings  
 
*Support for binary literals and underscores in number literals  
 
*Support for binary literals and underscores in number literals  
*Support for Unicode 6.0 in the scanner using tables like it was done for Unicode 5<br>
+
*Support for Unicode 6.0 in the scanner using tables like it was done for Unicode 5
 
*Support for SafeVarargs annotation
 
*Support for SafeVarargs annotation
 
*Support for try with resources  
 
*Support for try with resources  
 
*Support for the more precise rethrow analysis (this concerns only the handling of the throw statement)
 
*Support for the more precise rethrow analysis (this concerns only the handling of the throw statement)
 +
*Support for the improved type inference for generic instance creation (Diamond).
  
<br>If you find bugs in these areas, please report them against [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT JDT/Core] using the tags [1.7][compiler]. Thank you.
+
If you find bugs in these areas, please report them against [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT JDT/Core] using the tags [1.7][compiler]. Thank you.
  
= <br><br>What needs to be done:<br><br>  =
+
= What needs to be done: =
  
*Update the seach engine to support the new syntax<br>
+
*Add statement recovery for the new syntax<br>
*Update the index manager<br>
+
*Add support for diamond in the type inference of the compiler<br>
+
*Add a few more constants to control whitespaces inside the new syntax<br>
+
*Add code assist/statement recovery/code select for the new syntax<br>
+
  
<br>
+
= Current status =
  
= Current status<br>  =
+
*The code is no longer in the BETA state. Everything has been merged in HEAD stream (Juno) and in 3_7_maintenance stream (Indigo SR1)
 +
*JDT UI changes are tracked in [[JDT UI/Java7]]
 +
*JDT Debug changes are tracked in [[Debug/Java7]]
 +
*API Tools changes are tracked in [[PDE/API_Tools/Java7]]
  
*All tests are passing right now with the BETA_JAVA7 contents.
+
= What to do to set up the IDE =
*The following lines should be added in all headers of modified files for Java(tm) 7 implementation:<code>
+
  &nbsp;* This is an implementation of an early-draft specification developed under the Java
+
&nbsp;* Community Process (JCP) and is made available for testing and evaluation purposes
+
&nbsp;* only. The code is not compatible with any specification of the JCP.
+
&nbsp;*</code>
+
  
*No changes have been done in the UI for now (except for showing the early-draft blurb on the compiler compliance page).<br>
+
Download [http://www.eclipse.org/downloads/packages/eclipse-classic-372/indigosr2 Eclipse 3.7SR2]&nbsp;for out of the box support. Or, follow the steps below to get the JDT source code in an earlier build and launch a runtime workbench which will contain Java 7 features.<br>
  
<br>
+
*Import the following project sets using File &gt; Import, and then Team &gt; Team Project Set:
 +
**[[Media:BETA_JAVA7.psf|BETA_JAVA7.psf]] the code bundles
 +
**[[Media:BETA_JAVA7_JDT_UI_Tests.psf|BETA_JAVA7_JDT_UI_Tests.psf]] the UI tests
 +
**[[Media:BETA_JAVA7_JDT_Core_Tests.psf|BETA_JAVA7_JDT_Core_Tests.psf]] the Core tests
 +
**[[Media:BETA_JAVA7_API_Tools_Debug_Tests.psf|BETA_JAVA7_API_Tools_Debug_Tests.psf]] the API Tools and Debug tests
  
= What to do to set up the IDE<br> =
+
The tests project sets contain bundles that have not been branched. Using the <code>:pserver:anonymous</code> connection for those prevents you from accidentally committing something there.
  
Here are the steps to follow to retrieve the contents of the current implementation of the JSR334.<br>
+
*You need to install a JDK7 build as an installed JRE in order to run the tests using the JavaSE-1.7 Execution Environment.
 
+
*Create a new CVS repository location to:<br>:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse<br>
+
*Refresh the branches for the corresponding projects:<br>org.eclipse.jdt.core<br>org.eclipse.jdt.core.tests.builder<br>org.eclipse.jdt.core.tests.compiler<br>org.eclipse.jdt.core.tests.model<br>org.eclipse.jdt.core.tests.performance<br>org.eclipse.jdt.ui<br>
+
*You also need to grab the test framework project from the HEAD branch: org.eclipse.test.performance<br>
+
*You need to install a JDK7 build as an installed JRE in order to run the tests using a EE JavaSE-1.7.
+
 
+
<br>
+
  
= Disclaimer<br>  =
+
*For more information on how to configure Eclipse to update to the latest version of the Java 7 support see the [[JDT/Eclipse Java 7 Support (BETA)|Java 7 BETA support wiki page]].
  
This is a work in progress. The contents of the BETA_JAVA7 branch will be updated with the changes made to the JSR334 specification.<br><br>
+
If you need any help with this, please contact the JDT/Core team through either the [[Www.eclipse.org/forums/index.php|forums]] or [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT Bugzilla].
  
If you need any help with this, please contact the JDT/Core team through either the [[www.eclipse.org/forums/index.php|forums]] or [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT Bugzilla].
+
[[Category:JDT]]

Latest revision as of 21:46, 8 June 2012

This page will summarize all the work that is done to add Java(tm) 7 support (jsr334: project coin) into Eclipse. It might also be extended to other jsrs if needed. We still need to find out what changes are supposed to be done to support the jsr 292 in the compiler. This is not clear yet.

Current Status at the first glance


Java 7 features
Switch on Strings Binary Literals Underscores in Literals Multi-catch More Precise Rethrow
Try-with-Resources Simplified Varargs Method Invocation Diamond Polymorphic Methods Unicode 6.0
Update Indexing Update Code Formatter Update DOM/AST Update Search Update Error Recovery


   Completely implemented

Can be improved

What has been released so far:

  • Add new nodes inside the compiler ast to cover:
  1. Multi catch formal parameter ("catch( Ex1 | Ex2 | Ex3 e) {...").
    The new class is named: org.eclipse.jdt.internal.compiler.ast.UnionTypeReference
  • The grammar has been updated to cover the new syntax for multi-catch, try-with-resources and diamond case.
  • A new DOM/AST node have been added for the union type. The new class is: org.eclipse.jdt.core.dom.UnionType
  • The class org.eclipse.jdt.core.dom.TryStatement has been updated to support the new Try-with-Resources statement.
  • Two new constants have been added for the DOM nodes. There are the constants for the node type:
       org.eclipse.jdt.core.dom.ASTNode#UNION_TYPE
  • Experimental handling of java.dyn.MethodHandle.invokeExact(..)/invoke(..) (invokeGeneric(..) is now deprecated)
  • A new constant has been added for the JLS (JLS4) level in the org.eclipse.jdt.core.dom.AST class.
    This constant is needed for the new DOM/AST nodes to be created.
  • Content assist support for switch in strings, try with resources, multi-catch exceptions.


Work complete

  • Support for switch on strings
  • Support for binary literals and underscores in number literals
  • Support for Unicode 6.0 in the scanner using tables like it was done for Unicode 5
  • Support for SafeVarargs annotation
  • Support for try with resources
  • Support for the more precise rethrow analysis (this concerns only the handling of the throw statement)
  • Support for the improved type inference for generic instance creation (Diamond).

If you find bugs in these areas, please report them against JDT/Core using the tags [1.7][compiler]. Thank you.

What needs to be done:

  • Add statement recovery for the new syntax

Current status

  • The code is no longer in the BETA state. Everything has been merged in HEAD stream (Juno) and in 3_7_maintenance stream (Indigo SR1)
  • JDT UI changes are tracked in JDT UI/Java7
  • JDT Debug changes are tracked in Debug/Java7
  • API Tools changes are tracked in PDE/API_Tools/Java7

What to do to set up the IDE

Download Eclipse 3.7SR2 for out of the box support. Or, follow the steps below to get the JDT source code in an earlier build and launch a runtime workbench which will contain Java 7 features.

The tests project sets contain bundles that have not been branched. Using the :pserver:anonymous connection for those prevents you from accidentally committing something there.

  • You need to install a JDK7 build as an installed JRE in order to run the tests using the JavaSE-1.7 Execution Environment.

If you need any help with this, please contact the JDT/Core team through either the forums or Bugzilla.

Back to the top