Questions tagged [jsr335]

JSR 335: Lambda Expressions for the Java Programming Language

JSR 335 (Lambda Expressions for the Java Programming Language) aims to support programming in a multicore environment by adding closures and related features to the Java language. JSR-335 was delivered into Java SE 8 (tag java8) and is now completed.

(Excerpted from Project Lambda.)

4 questions
374
votes
5 answers

Why is "final" not allowed in Java 8 interface methods?

One of the most useful features of Java 8 are the new default methods on interfaces. There are essentially two reasons (there may be others) why they have been introduced: Providing actual default implementations. Example:…
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
223
votes
2 answers

What is the reason why “synchronized” is not allowed in Java 8 interface methods?

In Java 8, I can easily write: interface Interface1 { default void method1() { synchronized (this) { // Something } } static void method2() { synchronized (Interface1.class) { //…
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
13
votes
1 answer

Java lambdas (JSR 335): Why "eliminate support for unbound inner class constructor references"?

In the current JSR 335 draft, it's mentioned in the change log entry for 0.6.0 that it "eliminated support for unbound inner class constructor references". To illustrate, suppose you have an outer class named A and an inner class named B, and you…
C. K. Young
  • 219,335
  • 46
  • 382
  • 435
2
votes
2 answers

has JSR-335 special support in JVM? Boost for functional JVM-based languages?

JSR-335 is said to come soon along with Java 8. It brings i.e. support for closures and virtual extension methods. I wonder if there is any particular support for this on the JVM level? If so, can we hope for speed improvements in JVM-based…
ib84
  • 675
  • 5
  • 16