Jump to: navigation, search

Difference between revisions of "JDT UI/Java8"

Line 1: Line 1:
 
This page tracks the work in progress to add Java™ 8 support (mainly jsr308 "Type Annotations" and jsr335 "Lambda Expressions") into Eclipse JDT UI. See [[JDT Core/Java8]] for the work in the JDT Core plug-ins.  
 
This page tracks the work in progress to add Java™ 8 support (mainly jsr308 "Type Annotations" and jsr335 "Lambda Expressions") into Eclipse JDT UI. See [[JDT Core/Java8]] for the work in the JDT Core plug-ins.  
 +
 +
= Work areas =
 +
* Annotations on types
 +
* Receiver parameter on instance methods and inner class constructors
 +
* Default Methods
 +
* Lambda Expressions
 +
** check code that walks the parent chain to find the enclosing Block or BodyDeclaration
 +
* Method References
 +
  
 
= IMPORTANT NOTE =
 
= IMPORTANT NOTE =

Revision as of 04:28, 19 March 2013

This page tracks the work in progress to add Java™ 8 support (mainly jsr308 "Type Annotations" and jsr335 "Lambda Expressions") into Eclipse JDT UI. See JDT Core/Java8 for the work in the JDT Core plug-ins.

Work areas

  • Annotations on types
  • Receiver parameter on instance methods and inner class constructors
  • Default Methods
  • Lambda Expressions
    • check code that walks the parent chain to find the enclosing Block or BodyDeclaration
  • Method References


IMPORTANT NOTE

  • The following lines should be added in all headers of modified files for Java™ 8 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.
 *

DOM AST node changes in JLS8

If everything is correct, then you should find these as references to ASTNode#unsupportedIn2_3_4() and #supportedOnlyIn2_3_4().

+AnnotatableType (abstract superclass):
  +annotations: List<Annotation> (also in subtypes PrimitiveType, ArrayType, SimpleType, QualifiedType, WildcardType)

+ExtraDimensions
  +annotations: List<Annotation>

+LambdaExpression:
  +parentheses: boolean
  +parameters: List<SingleVariableDeclaration> or List<VariableDeclarationFragment>
  +body: Block or Expression
  +resolveMethodBinding(): IMethodBinding

~MethodDeclaration:
  +extraDimensions: List<ExtraDimension> (incl. annotations on extra dimensions)
  +receiverType: AnnotatableType
  +receiverQualifier: SimpleName
  -thrownExceptions: List<Name>
  +thrownExceptionTypes: List<Type>

~SingleVariableDeclaration:
  +varargsAnnotations: List<Annotation>

~TypeParameter:
  +annotations: List<Annotation>

~VariableDeclaration:
  +extraDimensions List<ExtraDimension> (also in subtypes SingleVariableDeclaration, VariableDeclarationFragment)

For JLS4, the changes were:

~TryStatement:
  +resources: List<VariableDeclarationExpression>

+UnionType
  +types: List<Type>

TODOs

  • 'default' flag:
    • show in the UI?
    • update JdtFlags?