Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] java8 default/defender methods in JDT?

Hi Ray,

On 10/03/2013 10:27 AM, Ray Cromwell wrote:

Hi Stephan,
   I don't know if you're the right person to send this to,

I'm just one (voluntary) committer for JDT/Core.
I can't make any statements about plans.
I'm cc'ing the mailing list read by the JDT/Core team.

> but I work on GWT at Google, our compiler that compiles Java to
Javascript which sits on top of JDT. Recently, I've started
> prototyping support for Java8 language features, so I grabbed a recent
build (from September 13 I believe),

While you don't mention, it seems you grabbed the correct branch (BETA_JAVA8), right?

> and managed to implement Lambda's and Method References, both LambdaExpression and
ReferenceExpression work as advertised and provide enough information for GWT.

Unfortunately, I have been unable to get even simple examples of default
> interface methods to work. Two problems always creep up.

#1 MethodDeclaration.statements is always null, even when the default method attribute bit is set.
#2 I can only declare void methods, non-void methods throw errors, e.g.

interface Provider<T> {
     T get();
     default int meaningOfLife() { return 42; } // ERROR: says method must return an int
}

This looks like a bug in your setup. Please see these tests for examples
of what is already working:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java?h=BETA_JAVA8


I'm also curious about timelines.
> We plan to introduce Java8 support around
the time of next year's Google I/O conference (~May/June), is Eclipse shooting
> to have Java8 support ready by then?

From all I know a patch feature with Java 8 support is planned immediately
following the Java 8 GA. If you need a more definite answer this has
to be provided by the compontent leads.

See also:
http://wiki.eclipse.org/JDT_Core/Java8
http://wiki.eclipse.org/JDT_UI/Java8
These may not be up-to-date to the day but may give you an idea
of what is happening.

best,
Stephan



Back to the top