SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
wtf
 is in Java/JDK/wtf 7      ???


                        Scott Leberknight
"Making Java suck (a little) less..."
jsr-203
(NIO.2)
// old way (deprecated)
File file = new File("foo.txt");




// new way
Path path = Paths.get("foo.txt");


Path path = file.toPath();



java.nio.file
Files
(finally, you can copy a file...only took ~15 years)




FileSystem(s)


FileStore
scalable, asynchronous I/O
                      (AsynchronousChannel & friends)




socket-channel binding
& config
(NetworkChannel & friends)
jsr-292
(invokedynamic)
invokedynamic
invokestatic                    invokespecial

invokevirtual                   invokeinterface

invokedynamic (new)



       "...an invokedynamic instruction is used to call
          methods which have linkage and dispatch
        semantics defined by non-Java languages..."
                         - http://www.infoq.com/articles/invokedynamic
jsr-334
 (Project Coin)
strings in switch


switch   (action) {
  case   "Red": stop(); break;
  case   "Yellow": slowDown(); break;
  case   "Green": go(); break;
  case   "Blue": danceAJig(); break;
}
binary literals




int clutchSong = 0b10001110101;




      http://www.amazon.com/Robot-Hive-Exodus-Clutch/dp/B0009NSE1K
short/byte literals



byte b = 42y;

short s = 32767s;
underscores in numeric literals



long max = 9_223_372_036_854_775_807L;

int song = 0b0100_0111_0101;
multi-catch


try {
  // code...
}
catch (FileNotFoundException | NoSuchFileException |
       AccessDeniedException ex) {
  // handle...
}
final re-throw

try {
  actionThatThrowsIOException();
  actionThatThrowsSQLException();
}
catch (final Exception e) {
  // handle...

    throw e;   // IOException or SQLException
}
ARM
                                             (automatic
                                               resource
                                           management)


try (InputStream is = url.openStream();
     OutputStream os = new FileOutputStream(file)) {

    // use resources...

}




                (AutoCloseable)
diamond operator



Map<String, Map<Integer, List<String>>> things =
  new HashMap<>();
modified JSRs
Java Compiler API (jsr 199)


JAXP 1.3 (jsr 206)


JAXB 2.2 (jsr 222)


JAX-WS 2.2 (jsr 224)


Pluggable Annotation Processing (jsr 269)
honorable mention
java.util.Objects
                          jsr166y - Concurrency &
                          collections updates

Enhanced JMX agent and
MBeans
                          Autoloading of JDBC
                          drivers

Method to close a
URLClassLoader
                          JDBC 4.1
assembly-coding

Class Loader architecture updates (parallel-capable)


Strict class file checking


Elliptic curve cryptography (ECC)


New garbage collector (lower pause times & better
predictability than current CMS collector)
deferred
    until JDK 8
   (sometime next century)
Project Lambda

       re d
      r
                                    (a.k.a. closures)




de fe       Collection Literals
         List<Integer> items = [1, 2,    3, 4, 5];




                                Modularity
          (JSR 294 modules, formerly superpackages)
references
http://jdk7.java.net/

http://openjdk.java.net/projects/jdk7/features/

http://jdk7.java.net/preview/

http://download.java.net/jdk7/docs/api/

http://www.infoq.com/articles/invokedynamic

http://www.vineetmanohar.com/2011/03/installing-java-7-on-mac-os-x/

http://marxsoftware.blogspot.com/2011/03/jdk-7-new-interfaces-
classes-enums-and.html
(the end)
scott.leberknight@nearinfinity.com
www.nearinfinity.com/blogs/
twitter: sleberknight

Weitere ähnliche Inhalte

Was ist angesagt?

UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File ServerUKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
Marco Gralike
 

Was ist angesagt? (20)

Cassandra 2.2 & 3.0
Cassandra 2.2 & 3.0Cassandra 2.2 & 3.0
Cassandra 2.2 & 3.0
 
OrientDB
OrientDBOrientDB
OrientDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
XQuery in the Cloud
XQuery in the CloudXQuery in the Cloud
XQuery in the Cloud
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
LibreCat::Catmandu
LibreCat::CatmanduLibreCat::Catmandu
LibreCat::Catmandu
 
Using Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into Cassandra
 
Sql cheat sheet
Sql cheat sheetSql cheat sheet
Sql cheat sheet
 
2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introduction2011 Mongo FR - MongoDB introduction
2011 Mongo FR - MongoDB introduction
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 Hour
 
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File ServerUKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
 
Not your Grandma's XQuery
Not your Grandma's XQueryNot your Grandma's XQuery
Not your Grandma's XQuery
 
Mongo db queries
Mongo db queriesMongo db queries
Mongo db queries
 
Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application
 
Latinoware
LatinowareLatinoware
Latinoware
 
Building .NET Apps using Couchbase Lite
Building .NET Apps using Couchbase LiteBuilding .NET Apps using Couchbase Lite
Building .NET Apps using Couchbase Lite
 
Debugging & Tuning in Spark
Debugging & Tuning in SparkDebugging & Tuning in Spark
Debugging & Tuning in Spark
 
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
 
XQuery Rocks
XQuery RocksXQuery Rocks
XQuery Rocks
 

Andere mochten auch

Andere mochten auch (19)

iOS
iOSiOS
iOS
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
Rack
RackRack
Rack
 
jps & jvmtop
jps & jvmtopjps & jvmtop
jps & jvmtop
 
iOS 101 - Xcode, Objective-C, iOS APIs
iOS 101 - Xcode, Objective-C, iOS APIsiOS 101 - Xcode, Objective-C, iOS APIs
iOS 101 - Xcode, Objective-C, iOS APIs
 
Advanced iOS
Advanced iOSAdvanced iOS
Advanced iOS
 
httpie
httpiehttpie
httpie
 
Cloudera Impala
Cloudera ImpalaCloudera Impala
Cloudera Impala
 
RESTful Web Services with Jersey
RESTful Web Services with JerseyRESTful Web Services with Jersey
RESTful Web Services with Jersey
 
Hadoop
HadoopHadoop
Hadoop
 
Introduction to Objective - C
Introduction to Objective - CIntroduction to Objective - C
Introduction to Objective - C
 
Java 8 Lambda Expressions
Java 8 Lambda ExpressionsJava 8 Lambda Expressions
Java 8 Lambda Expressions
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
HBase Lightning Talk
HBase Lightning TalkHBase Lightning Talk
HBase Lightning Talk
 
Google Guava
Google GuavaGoogle Guava
Google Guava
 
Apache ZooKeeper
Apache ZooKeeperApache ZooKeeper
Apache ZooKeeper
 
200810 - iPhone Tutorial
200810 - iPhone Tutorial200810 - iPhone Tutorial
200810 - iPhone Tutorial
 
Awesomizing your Squarespace Website
Awesomizing your Squarespace WebsiteAwesomizing your Squarespace Website
Awesomizing your Squarespace Website
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 

Ähnlich wie wtf is in Java/JDK/wtf7?

JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
Nick Sieger
 
[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool
javablend
 

Ähnlich wie wtf is in Java/JDK/wtf7? (20)

Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
 
Java
JavaJava
Java
 
Java7 New Features and Code Examples
Java7 New Features and Code ExamplesJava7 New Features and Code Examples
Java7 New Features and Code Examples
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
 
Nantes Jug - Java 7
Nantes Jug - Java 7Nantes Jug - Java 7
Nantes Jug - Java 7
 
Jet presentation
Jet presentationJet presentation
Jet presentation
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
 
What`s new in Java 7
What`s new in Java 7What`s new in Java 7
What`s new in Java 7
 
JRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing WorldJRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing World
 
[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool
 
Testing with Node.js
Testing with Node.jsTesting with Node.js
Testing with Node.js
 
Gatling - Paris Perf User Group
Gatling - Paris Perf User GroupGatling - Paris Perf User Group
Gatling - Paris Perf User Group
 
RxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowRxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrow
 
JBoss AS Upgrade
JBoss AS UpgradeJBoss AS Upgrade
JBoss AS Upgrade
 
Collections forceawakens
Collections forceawakensCollections forceawakens
Collections forceawakens
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
 
Lobos Introduction
Lobos IntroductionLobos Introduction
Lobos Introduction
 
Modern Java Development
Modern Java DevelopmentModern Java Development
Modern Java Development
 

Mehr von Scott Leberknight

Mehr von Scott Leberknight (6)

JShell & ki
JShell & kiJShell & ki
JShell & ki
 
JUnit Pioneer
JUnit PioneerJUnit Pioneer
JUnit Pioneer
 
JDKs 10 to 14 (and beyond)
JDKs 10 to 14 (and beyond)JDKs 10 to 14 (and beyond)
JDKs 10 to 14 (and beyond)
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
SDKMAN!
SDKMAN!SDKMAN!
SDKMAN!
 
JUnit 5
JUnit 5JUnit 5
JUnit 5
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

wtf is in Java/JDK/wtf7?