Presentation The Heads and Tails of Project Coin
CORE JAVA PLATFORM
22641
Published on: 2011-10-06T16:53:51.000Z
Channel: JavaOne 2011 (all)
Tags: javase7 ProjectCoin oracle JavaOne11
Speakers:
maurizio cimadamore
$speaker.bio
Joseph Darcy
Joe is currently the lead engineer of Project Coin, the effort to select and implement a set of small Java language changes for JDK 7. He also serves as a member of the JDK 7 release team. Concurrently, Joe continues to be the release manager, lead engineer, and quality lead for OpenJDK 6, an open source implementation of the Java SE 6 platform.A longtime member of the JDK engineering group, Joe was previously specification lead for JSR 269, the Pluggable Annotation Processing API, which delivered a standardized annotation processing API and mirror-based language model into JDK 6 to supersede the earlier apt tool from JDK 5. Joe assisted in implementing the JDK 5 language changes with work spanning core reflection, javac hacking, and general library support.
Joe holds a master's degree in computer science from UC Berkeley and a master's degree in applied math from Stanford University.
PDF: slides.pdf
Slides:
The Heads and Tails of Project Coin
The Heads and Tails of Project Coin
Joseph D. Darcy (@jddarcy)
2 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
#include "std_orcl_disclaimer.h"
#include "std_orcl_disclaimer.h"
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle's products remains at the sole discretion of Oracle.
3
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Outline
Outline
· · · · Overview and Demo Retrospective on developing JDK 7 Coin features Possible small language changes in JDK 8 and later Q&A
5
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JDK 7 Survey
JDK 7 Survey
· Downloaded JDK 7 GA?
JDK7 Mac OS X Port Developer Preview Release
http://jdk7.java.net/macportpreview/
· Downloaded JDK 7 update build?
http://jdk7.java.net/preview/
· coin-dev subscriber?
http://mail.openjdk.java.net/mailman/listinfo/coin-dev/
· OpenJDK contributor?
http://openjdk.java.net/contribute/
6 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Project Coin Benefits
Project Coin Benefits
Enjoy improved free code flow today!
· Remove extra text to make programs more readable · Encourage writing programs that are more reliable · Integrate well with past and future changes
7
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Coin Constraints
Coin Constraints
· Small language changes
Specification Implementation Testing
· No JVM changes! · Coordinate with forthcoming larger language changes · Beware the hazards of language interactions!
8
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
The Six Coin Features and How They Help
The Six Coin Features and How They Help
· Easier to use generics
Diamond Varargs warnings
· More concise error handling
Multi-catch try-with-resources
· Consistency and clarity
Strings in switch Literal improvements
9 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Project Coin support in IDEs
Project Coin support in IDEs
Pick an IDE, any IDE
· IntelliJ IDEA 10.5 and later
http://blogs.jetbrains.com/idea/2011/02/announcing-intellij-idea-105-with-full-java-7-support/
· Eclipse 3.7.1 and later
http://www.eclipse.org/jdt/ui/r3_8/Java7news/whats-new-java-7.html
· NetBeans 7.0 and later
http://netbeans.org/kb/docs/java/javase-jdk7.html
DEMO
10 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
untitled
Varargs Warnings
Varargs Warnings
· Summary: no longer receive uninformative unchecked compiler warnings from calling platform library methods:
List Arrays.asList(T... a) boolean Collections.addAll(Collection super T> c, T... elements) > EnumSet EnumSet.of(E first, E... rest) void javax.swing.SwingWorker.publish(V... chunks)
· New annotation type SafeVarargs
12
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
How Coins were Minted
How Coins were Minted
· Internal compiler desugaring
strings in switch try-with-resources
http://www.usmint.gov/about_the_mint/coinLibrary/
Easy for the programmer, more work for the compiler!
· Coordinated Library Changes
java.lang.{AutoCloseable, SafeVarargs} Throwable.addSuppressed Serialized form of Throwable, new c'tors
· Systematic application of new library features
14 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
// Original sugared switch(s) { case "a": case "b": return 10;
// Original sugared switch(s) { case "a": case "b": return 10;
case "c": case "d": return 20; ...
// s mapped to offset switch($t) { case 1: case 2: return 10; case 3: case 4: return 20; ... }
}
15 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
// Desugared int $t = -1; switch(s.hashCode()) { case 0x61: // "a".hashCode() if(s.equals("a")) $t = 1; break; case 0x62: if(s.equals("b")) $t = 2; break; ... }
// Desugared int $t = -1; switch(s.hashCode()) { case 0x61: // "a".hashCode() if(s.equals("a")) $t = 1; break; case 0x62: if(s.equals("b")) $t = 2; break; ... }
// Original sugared switch(s) { case "a": case "b": return 10;
case "c": case "d": return 20; ...
// s mapped to offset switch($t) { case 1: case 2: return 10; case 3: case 4: return 20; ... }
}
16 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
try-with-resources desugaring
try-with-resources desugaring
try ResourceSpecification Block
{ final VariableModifiers_minus_final R #resource = Expression; Throwable #primaryException = null; try ResourceSpecificationtail Block catch (Throwable #t) { #primaryException = t; throw #t; } finally { if (#resource != null) { if (#primaryException != null) { try { #resource.close(); } catch(Throwable #suppressedException) { #primaryException.addSuppressed(#suppressedException); } } else { #resource.close(); } } }
}
17 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Library support for try-with-resources
Library support for try-with-resources
Not just a language feature!
· New superinterface java.lang.AutoCloseable
All AutoCloseable and by extension java.io.Closeable types usable with try-with-resources
· Retrofit Closeable/AutoCloseable to Java SE API
JDBC 4.1 retrofitted as AutoCloseable too
· Suppressed exceptions are recorded for posterity using a new facility Throwable.addSuppressed
Suppressed exception info included in stack trace, etc.
18
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Throwable
Throwable
· New field added to store suppressed exception data · HotSpot specially creates certain exception objects
Allow stack traces for OutOfMemoryError Need to document and follow a VM libraries protocol
· Serial compatibility must be kept with older releases
IIOP serialization matters too!
· Exception objects should be able to be immutable
New constructors added to Throwable Preserve immutability on serialize deserialize cycle
19 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
A Systematic Update
A Systematic Update
· Ran annotation processors over the JDK
Types to be retrofitted as Closeable/AutoCloseable: Project Coin: Bringing it to a Close(able),
http://blogs.sun.com/darcy/entry/project_coin_bring_close/
Methods and constructors to be annotated with @SafeVarargs
Project Coin: Safe Varargs in JDK Libraries, http://blogs.sun.com/darcy/entry/project_coin_safe_vararg_libraries/
· Can run the same processors over your own code
20
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Retrospective
Retrospective
In the beginning...
· A small language change needs to be small in all of:
http://www.usmint.gov/about_the_mint/coinLibrary/
Specification Implementation Testing
· Not the only relevant dimensions
21
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
http://hubblesite.org/gallery/album/the_universe/pr2009002a/xlarge_web/
http://hubblesite.org/gallery/album/the_universe/pr2009002a/xlarge_web/
22 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
for (Coin coin : jdk7Coins){...}
for (Coin coin : jdk7Coins){...}
http://www.flickr.com/photos/museumofworldwonders/5446037241/
· · · · ·
Project Coin specification as a whole Design issues and alternatives, surprises Size of implementation Specification and implementation evolution Bug tail
23
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
24
24
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Cross references in Java SE 7 JLS
Cross references in Java SE 7 JLS
25
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JLS Sections Changed by Project Coin
JLS Sections Changed by Project Coin
· Improved Literals §3.10.1 "Integer Literals" §3.10.2 "Floating-Point Literals" · Strings in Switch §14.11 "The switch Statement" · Safe varargs §4.8 "Raw Types" §4.12.2 "Variables of Reference Type" §8.4.1 "Formal Parameters" §9.6.3.7 "SafeVarargs" (New!) §15.12.4.2 "Evaluate Arguments"
26 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
· Diamond §15.9 "Class Instance Creation Expressions" §15.9.1 "Determining the Class being Instantiated" §15.9.3 "Choosing the Constructor and its Arguments" §18 "Syntax"
More JLS sections changed by Project Coin
More JLS sections changed by Project Coin
· Multi-catch §4.12.4 "final Variables" §11.2.2 "Exception Analysis of Statements" §11.2.3 "Exception Checking" §13.4.4 "Superclasses and Superinterfaces" §14.20 "The try statement" §18 "Syntax" · try-with-resources §4.12.4 "final Variables" §6.3 "Scope of a Declaration" §6.4 "Shadowing and Obscuring" §11.2.2 "Exception Analysis of Statements" §14.20 "The try statement" §14.20.3 "try-with-resources" (New!) §18 "Syntax"
27
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Coin Cross Reference subgraph
Coin Cross Reference subgraph
28
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
1. Improved literals
1. Improved literals
· Grammar changes a bit tricky to get right; multiple underscores between digits:
Digits: Digit Digit DigitsAndUnderscoresopt Digit
DigitsAndUnderscores: DigitOrUnderscore DigitsAndUnderscores DigitOrUnderscore
29 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Implication of multiple underscores
Implication of multiple underscores
Do we want this to be allowed?
// Courtesy Josh Bloch int bond = 0000_____________0000________0000000000000000__000000000000000000+ 00000000_________00000000______000000000000000__0000000000000000000+ 000____000_______000____000_____000_______0000__00______0+ 000______000_____000______000_____________0000___00______0+ 0000______0000___0000______0000___________0000_____0_____0+ 0000______0000___0000______0000__________0000___________0+ 0000______0000___0000______0000_________000+__0000000000+ 0000______0000___0000______0000________0000+ 000______000_____000______000________0000+ 000____000_______000____000_______00000+ 00000000_________00000000_______0000000+ 0000_____________0000________000000007;
30
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
What about octal?
What about octal?
If these are illegal integer literals 0x_abcd 0b_0101 should 0_1234
be legal?
31
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Implementing literals
Implementing literals
· 1 small changeset · No post-integration surprises
32
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
2. Strings in switch: specification change
2. Strings in switch: specification change
JLS §14.11 The switch Statement "The type of [the switch] Expression must be char, byte, short, int, Character, Byte, Short, Integer, String, or an enum type (§8.9), or a compile-time error occurs."
33
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Strings in switch proposal form
Strings in switch proposal form
instead of hashCode. Generally a String.equals() check will be needed to verify the candidate string's identity in addition to the evaluation of the screening PROJECT COIN SMALL LANGUAGE CHANGE PROPOSAL FORM v1.0 AUTHOR(S): Joseph D. Darcy function because multiple string inputs could evaluate to the same result. OVERVIEW A single case label, a single case label with a default, and two case labels can be special-cased to just equality checks without function evaluations. If there are collisions in String.hashCode on the set of case labels in a switch block, a different function without collisions on that set of inputs should be used; for Provide a two sentence or shorter description of these five aspects of the feature: example ((long)s.hashCode<<32 ) + s.length()) is another candidate function. FEATURE SUMMARY: Should be suitable as a summary in a language tutorial. Here are desugarings to currently legal Java source for the two examples above where the default hash code do not collide: Add the ability to switch on string values analogous to the existing ability to switch on values of the primitive types. // Simple Example if (s.equals("foo")) { // cause NPE if s is null processFoo(s); } // Advanced example { // new scope for synthetic variables boolean MAJOR ADVANTAGE: What makes the proposal a favorable change? More regular coding patterns can be used for operations selected on the basis of a set of constant string values; the meaning of the new construct should be $take_default = false; boolean $fallthrough = false; $default_label: { switch(s.hashCode()) { // cause NPE if s is null case 3482567: // "quux".hashCode() if (!s.equals("quux")) { $take_default = true; break $default_label; } processQuux(s); $fallthrough = true; case 101574: // "foo".hashCode() if (!$fallthrough && obvious to Java developers. !s.equals("foo")) { $take_default = true; break $default_label; } $fallthrough = true; case 97299: // "bar".hashCode() if (!$fallthrough && !s.equals("bar")) { MAJOR BENEFIT: Wh
Strings in switch spec. and implementation
Strings in switch spec. and implementation
What is there to discuss?
· What does switching on a null do? · Can null be a case label? · JDK 7 implementation relies on a particular algorithm be used for String.hashCode · Many other implementation options
Secondary hash if collisions on primary hash Perfect hash functions Labeled-break
35 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Project Coin: Taking a Break for Strings in Switch
Project Coin: Taking a Break for Strings in Switch
http://blogs.oracle.com/darcy/entry/project_coin_string_switch_break
static void f(String s) { // Original sugared code switch (s) { case "azvl": System.out.println("azvl: "+s); // fallthrough case "quux": System.out.println("Quux: "+s); // fallthrough case "foo": int i = 5; //fallthrough case "bar": System.out.println("FooOrBar " + (i = 6) + ": "+s); break; case "bmjrabc": // same hash as "azvl" System.out.println("bmjrabc: "+s); break; case "baz": System.out.println("Baz " + (i = 7) + ": "+s); // fallthrough default: System.out.println("default: "+s); } }
36
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
static void f(String s) { // Desugared code $exit: { int i$foo = 0; $default_label: { $baz: { $bmjrabc: { $bar: { $foo: { $quux: { $azvl: { switch(s.hashCode()) { // cause NPE if s is null case 3010735: // "azvl" and "bmjrabc".hashCode() if (s.equals("azvl")) break $azvl; else if (s.equals("bmjrabc")) break $bmjrabc; else break $default_label; case 3482567: // "quux".hashCode() if (!s.equals("quux")) // inequality compare break $default_label; break $quux; case 101574: // "foo".hashCode() if (s.equals("foo")) // equality compare break $foo; break $default_label; case 97299: // "bar".hashCode() if (!s.equals("bar")) break $default_label; break $bar; case 97307: // "baz".hashCode() if (!s.equals("baz")) break $default_label; break $baz; default: break $default_label; }//switch }//azvl System.out.println("azvl: "+s); // fallthrough } //quux System.out.println("Quux: "+s); // fallthrough } //foo i$foo = 5; }//bar System.out.println("FooOrBar " + (i$foo = 6) + ": "+s); break $exit; }//bmjrabc System.out.println("bmjrabc: " + s); break $exit; } //baz System.out.println("Baz " + (i$foo = 7) + ": "+s); // fallthrough }//default_label System.out.println("default: "+s); }//exit }
Strings in switch implementation history
Strings in switch implementation history
· Original changeset quickly followed by small refinement · Bug fix in 7u2: switch(s) { case("a"): // Extra parentheses // would crash javac ...
37
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
3. SafeVarargs
3. SafeVarargs
Background
· Often preferable to have a sound system of warnings
No missed cases (no false negatives) But may have false positives
38
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
"...the [Java] language is designed to guarantee that if your entire application has been compiled without unchecked warnings [...], it is type safe."
"...the [Java] language is designed to guarantee that if your entire application has been compiled without unchecked warnings [...], it is type safe."
Generics in the Java Programming Language
http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
Gilad Bracha, Computational Theologist (emer.)
39
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Heap Pollution
Heap Pollution
"Heap pollution can only occur if the program performed some operation involving a raw type that would give rise to a compile-time unchecked warning [...] or if the program aliases an array variable of non-reifiable element type through an array variable of a supertype which is either raw or non-generic." JLS §4.12.2 Variables of Reference Type
41
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Unchecked Warnings and Soundness
Unchecked Warnings and Soundness
· Unchecked warnings are intended to be a sound analysis · From a certain point of view, it would be correct (but unhelpful!) to always emit an unchecked warning · Pre-JDK 7, always got an unchecked warning when calling certain varargs library methods
Bad, and complicated interaction between generics and arrays But usually nothing actually dangerous happens!
42
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Limits of SafeVarargs
Limits of SafeVarargs
· Impractical to standardize a sufficiently powerful sound analysis in JDK 7
Just "read-only" not sufficient Just "invariant" not sufficient Aliasing complicates analysis (Standardizing definitely assigned/definitely unassigned dataflow analysis tricky!)
· Leave such standardization for future work; quality of implementation issue in the meantime
43 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
SafeVarargs history
SafeVarargs history
· Prototype based on SuppressWarnings · Second implementation based on SafeVarargs
What's in a name? @TrustMe @CleanVarargs ...
· Very extensive regression/unit tests using auto-generated source files over 7 variables
44
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Designing the SafeVarargs annotation type
Designing the SafeVarargs annotation type
· Annotations on methods are not inherited · @SafeVarargs can therefore only be applied to
Static methods Constructors final instance methods
· Additional checks on varargs status, etc. · Runtime retention policy
45
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
4. Diamond <>
4. Diamond <>
· Diamond uses type inference to figure out types so the programmer doesn't have to write them · Type inference is a constraint satisfaction problem
What are the constraints? How can they be satisfied?
· Want a unique answer returned by the algorithm
46
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
More than one facet
More than one facet
· Two inference schemes proposed, differing in how they gathered constraints · Each sometimes more useful than the other · Use quantitative analysis to help resolve the issue
Prototype both schemes Analyze results on millions of files of code
47
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Quantitative Results
Quantitative Results
· Both schemes equally effective
Each could eliminate a different 90% of the explicit type parameters to constructor calls Verified diamond was a worthwhile feature!
· Choose inference scheme with better evolution and maintenance properties
· Language designer's notebook: Quantitative language design
http://www.ibm.com/developerworks/java/library/j-ldn1/
48
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Hofstadter's Law: "It always takes longer than you expect, "even when you take into account Hofstadter's Law."
Hofstadter's Law: "It always takes longer than you expect, "even when you take into account Hofstadter's Law."
Douglas Hofstadter
Gödel, Escher, Bach: An Eternal Golden Braid
49
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Law of Evolving the Java Language: "There are always more interactions than you expect, "even when you expect lots of interactions."
Law of Evolving the Java Language: "There are always more interactions than you expect, "even when you expect lots of interactions."
CUSTOMER LOGO
50
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Diamond and anonymous classes
Diamond and anonymous classes
public class Box { private T value;
public Box(T value) { this.value = value; }
Object o; List> arg = ...; o = new Box<>(arg);
T getValue() { return value; } }
51
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Object o; List> arg = ...; o = new Box >(arg);
Object o; List> arg = ...; o = new Box >(arg);
52
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Object o; List> arg = ...; o = new Box >(arg){...};
Object o; List> arg = ...; o = new Box >(arg){...};
53
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Object o; List> arg = ...; o = new a$1(arg);
Object o; List> arg = ...; o = new a$1(arg);
Anonymous classes translate into a new class file with a full set of attributes.
class a$1 extends Box >{...}
54 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Diamond and generic constructors
Diamond and generic constructors
class Foo { // The rare generic constructor! Foo(S s) {super();} }
Class Explicit Explicit Inferred Constructor Explicit Inferred Explicit Supported Yes Yes No Example new Foo(null); new Foo(null); new Foo<>(null); // compile error
Inferred
Inferred
Yes
new Foo<>(null);
Project Coin: Diamond and Generic Constructors
http://blogs.oracle.com/darcy/entry/project_coin_diamond_generic_constructors
55 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
5. Multi-catch and more precise rethrow
5. Multi-catch and more precise rethrow
Does it matter if this code doesn't compile in JDK 7?
try { throw new DaughterOfFoo(); } catch (Foo exception) { try { // Pre-JDK 7 throws Foo, now throws DaughterOfFoo throw exception; } catch (SonOfFoo anotherException) { ; // Reachable? } }
56
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Multi-catch evolution
Multi-catch evolution
· Reformulated rules for can-throw computation · Used new "effectively final" analysis · What is the meaning of catch(Foo | SonOfFoo e) {...}
Explicitly disallowed in JDK 7 Could be added later
57
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
6. try-with-resources
6. try-with-resources
Largest of the Coins
· Changes to semantics of desugaring
Suppress only Exceptions or all Throwables? Null handling
· Syntax changes
Allow trailing ";" in resource list Forbid expression form without explicit declaration
· Throwable changes · AutoCloseable and InterruptedException
58 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Diamond
Diamond
Design Complexity
try-with-resources Multi-catch and more precise rethrow @SafeVarargs Strings in switch Improved literals
Implementation Effort
59 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Project Coin Proposals in JDK 7
Project Coin Proposals in JDK 7
10 70
Submitted Proposals Per Day
8 50
6
40 30 20
4
2 10 0 0
Days after Opening
60
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Total Submitted Proposals
60
JSR 334 Through the JCP
JSR 334 Through the JCP
Expert Group Formation Early Draft Review
Jan 11, 2011
Public Review
March 24, 2011
Proposed Final June 24, 2011 Draft
JSR Approval Ballot
Dec 06, 2010
Final July 5, 2011 Approval Ballot
JSR Proposal
62
Nov 16, 2010
July 18, 2011
Final Release
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Project Coin Language Changes in JDK 7
Project Coin Language Changes in JDK 7
· Methodical and quantitative approach
Decide today what needs to be decided today Consciously leave room for future decisions
· Language + library co-evolution (But no VM changes for Coin!) · Smooth transition to new features
Widespread tool support Use of new features reads well
· What about JDK 8?
63 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Language/compiler changes expected in JDK 8
Language/compiler changes expected in JDK 8
· Project Lambda: To Multicore and Beyond Alex Buckley and Daniel Smith
Bulk Data Handling, Mike Duigou, Thursday, 11:00 am · Project Jigsaw: Putting It All Together, Mark Reinhold
Project Jigsaw: Find the Corner Pieces First, Alan Bateman, Mandy Chung, Mark Reinhold · JSR 308 Annotations on Types
64 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
(Very) Small Language changes
(Very) Small Language changes
Under consideration for JDK 8
· Only opportunistic changes given scope of Lambda and Jigsaw · Refinements to JDK 7 Project Coin features
try-with-resources on an effectively final variable? Remove some restrictions on diamond? @SafeVarargs on a private method?
· Collection literals? · Repeating annotations? · Parameter names available at runtime?
66 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.