Skip to main content
Jump to: navigation, search

Difference between revisions of "JDT Core/Java7"

(What to do to set up the IDE)
(What to do to set up the IDE)
Line 96: Line 96:
  
 
*Create a new CVS repository location to:<br>:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse<br>  
 
*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>
+
*Check out the BETA_JAVA7 branches of the corresponding projects:<br>org.eclipse.jdt.core<br>org.eclipse.jdt.ui<br>org.eclipse.jdt.launching<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>
 
*You also need to grab the test framework project from the HEAD branch: org.eclipse.test.performance<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.
+
*And from the repository<br>:pserver:anonymous@dev.eclipse.org:/cvsroot/rt<br>you also need to take branch BETA_JAVA7 of project org.eclipse.osgi
*Once a new eclipse workbench is launched using the plugins specified above, an extra step is required to change a project compliance to 1.7 or to create a new project with 1.7 compliance. This is because the UI currently does not show an option for setting it to 1.7. To do this, open the org.eclipse.jdt.core.prefs file in the project (this can be seen in the Navigation view), and set the org.eclipse.jdt.core.compiler.compliance and org.eclipse.jdt.core.compiler.source settings to 1.7. See bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=344729
+
*You need to install a JDK7 build as an installed JRE in order to run the tests using the JavaSE-1.7 Execution Environment.
 
+
 
<br>
 
<br>
  

Revision as of 18:17, 5 May 2011

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

Partially implemented or "can be improved"

Not implemented

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.DisjunctiveTypeReference
  • 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 disjunctive type. The new class is: org.eclipse.jdt.core.dom.DisjunctiveType
  • 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#DISJUNCTIVE_TYPE
  • Experimental handling of java.dyn.MethodHandle.invokeExact(..)/invokeGeneric(..)
  • 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:

  • Update the seach engine to support the new syntax
  • Update the index manager
  • Add a few more constants to control whitespaces inside the new syntax
  • Add code assist/statement recovery/code select for the new syntax


Current status

  • All tests are passing right now with the BETA_JAVA7 contents.
  • The following lines should be added in all headers of modified files for Java(tm) 7 implementation:
 * This is an implementation of an early-draft specification developed under the Java
 * Community Process (JCP) and is made available for testing and evaluation purposes
 * only. The code is not compatible with any specification of the JCP.
 *
  • No changes have been done in the UI for now (except for showing the early-draft blurb on the compiler compliance page).


What to do to set up the IDE

Here are the steps to follow to retrieve the contents of the current implementation of the JSR334.

  • Create a new CVS repository location to:
    :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
  • Check out the BETA_JAVA7 branches of the corresponding projects:
    org.eclipse.jdt.core
    org.eclipse.jdt.ui
    org.eclipse.jdt.launching
    org.eclipse.jdt.core.tests.builder
    org.eclipse.jdt.core.tests.compiler
    org.eclipse.jdt.core.tests.model
    org.eclipse.jdt.core.tests.performance
  • You also need to grab the test framework project from the HEAD branch: org.eclipse.test.performance
  • And from the repository
    :pserver:anonymous@dev.eclipse.org:/cvsroot/rt
    you also need to take branch BETA_JAVA7 of project org.eclipse.osgi
  • You need to install a JDK7 build as an installed JRE in order to run the tests using the JavaSE-1.7 Execution Environment.


Disclaimer

This is a work in progress. The contents of the BETA_JAVA7 branch will be updated with the changes made to the JSR334 specification.

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

Back to the top