Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

JDT Core/Java7

< JDT Core
Revision as of 14:39, 27 January 2011 by Olivier Thomann.ca.ibm.com (Talk | contribs) (Current status)

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.

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
  2. Try-with-resources (aka ARM: Automated Resource Management)
    The new class is named: org.eclipse.jdt.internal.compiler.ast.TryStatementWithResources
  • 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
  • A new constant has been added for the DOM node. This is the constant for the node type: org.eclipse.jdt.core.dom.ASTNode#DISJUNCTIVE_TYPE
  • Support for switch on strings. This is supposed to work fine.
  • Support for binary literals and underscores in number literals.



What needs to be done:

  • Update the seach engine to support the new syntax
  • Update the index manager
  • Add new DOM/AST node for the try-with-resources statement
  • Add type resolution, data flow analysis, code generation for the try-with-resources statement
  • Add support for diamond in the type inference of the compiler
  • Update the code formatter to support the new syntax. For 3.7, no new code formatter constants are expected
  • Add support for simplified varargs invocation
  • Implement the more precise rethrow algorithm in the compiler
  • Add code assist/statement recovery/code select for the new syntax


Current status

  • Some tests are failing right now with the BETA_JAVA7 contents. The following link contains all current failures.

Save this file as text and then from the JUnit view import the corresponding file.

  • 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.


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
  • Refresh the branches for the corresponding projects:
    org.eclipse.jdt.core
    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: org.eclipse.test.performance
  • You need to install a JDK7 build as an installed JRE in order to run the tests using a EE JavaSE-1.7.


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 (www.eclipse.org/forums/index.php) or Bugzilla (bugs.eclipse.org/bugs/enter_bug.cgi).

Back to the top