Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

JavaOne 2015 - Java SE Update

JavaOne 2015 Report
about Java SE

JavaOne 2015 - Java SE Update

  1. 1. Ed itio n Java S E» _ __: :- . »— « - * C “Java in the Box Yuichi Sakuraba /41 ~.
  2. 2. 4 , WW . . i. / . x. C. ._ 43 . 4.1.. . 3! 1iuI. .|Ii| ..l_ sh . _. U. . .. . . . / m, m. 1 i 5 ii‘ i . l t x u. x. x C ; .. v. . f» T . . . r. _ .3. . V x i . ri . ._: .L .1 . ..l .9 mi _ ,
  3. 3. r ‘ >A. ‘c F“ ‘ a J (‘V ,4 2 W ' 9 ‘ i L. ‘- / 0 } fl " »r/ /1 ‘ .5 , ,,, _ A‘. l v / ( v ' I1‘ I = .. ~- 0 $ Mark Reinhold Alex Buckley Alan Bateman Mandy Chung p .
  4. 4. .. J I . / 4 , . c. .. 4 . L / Viv . M. .. . .w a « J, ii; ii. , i . . . .x. < , . 7
  5. 5. 7' x‘, uj W Hugestndar Lilo
  6. 6. JAR HELL I Lack of JAR Conflict of JAR * Effect of Internal Upd
  7. 7. JAR HELL I (3 No Dependency ‘E T H, .fJ]’i No Version No Limitation of Clas
  8. 8. JAR HELL I No Dependency No Version M ‘f L-
  9. 9. Module extends JAR{ dependency exportation version
  10. 10. Module extends JAR{ dependency exportation version } DEFINITION module-info. java
  11. 11. main() beta — Beta. java src]: com—foo — bar]: alpha —A| pha. java module-info. java module com. foo. bar { }
  12. 12. module com. foo. bar { / / module dependency requires com. foo. baz; }
  13. 13. module com. foo. bar { / / module dependency requ'i res com. foo. baz; use Mpha / / puckage exportation exports com. foo. bar. alpha; } public -)0 accessible
  14. 14. Compile > javac -mp mods -d bin/ com. foo. bar src/ module-info. java src/ com/ foo/ bar/ alpha/ Alpha. java src/ com/ foo/ bar/ beta/ Beta. java Make Module > jar --create --file mods/ foobar. jar --module-version 1.0 -C bin/ com. foo. bar . Execution > Java -mp mods —m com. foo. bar/ com. foo. bar. alpha. Alpha 4} Afi- Module Class
  15. 15. PROBI-EMSHuge Standard Lib
  16. 16. PLATFORM MODULES
  17. 17. PLATFORM MODULES > java -listmods java. activation@9.0 java. xml. crypto@9.0 jdk. jconsole@9.0 java. annotations. common@9.0 java. xml. ws@9.0 jdk. jdeps@9.0 java. base@9.0 javafx. base@9.0 jdk. jdi@9.0 java. compact1@9.0 javafx. controls@9.0 jdk.1dwp. agent@9.0 java. compact2@9.0 javafx. deploy@9.0 jdk.1fr@9.0 java. compact3@9.0 javafx. fxml@9.0 jdk.1link@9.0 java. compiler@9.0 javafx. graphics@9.0 jdk. Jvmstat@9.0 java. corba@9.0 javafx. media@9.0 jdk. localedata@9.0 java. datatransfer@9.0 javafx. swing@9.0 jdk. management@9.0 java. desktop@9.0 javafx. web@9.0 jdk. naming. dns@9.0 java. instrument@9.0 jdk. accessibility@9.0 jdk. naming. rmi@9.0 java. logging@9.0 jdk. attach@9.0 jdk. pack200@9.0 java. management@9.0 Jdk. charsets@9.0 jdk. plugin@9.0 java. naming@9.0 jdk. compiler@9.0 Jdk. plugin. dom@9.0 java. prefs@9.0 jdk. crypto. ec@9.0 jdk. pol1cytool@9.0 java. rmi@9.0 jdk. crypto. mscapi@9.0 1dk. rmic@9.0 java. scripting@9.0 jdk. crypto. pkcs11@9.0 1dk. scripting. nashorn@9.0 java. se@9.0 Jdk. deploy@9.0 Jdk. scripting. nashorn. shell@9.0 java. security. jgss@9.0 jdk. hotspot. agent@9.0 jdk. sctp@9.0 java. security. sasl@9.0 jdk. httpserver@9.0 jdk. security. auth@9.0 java. smartcardio@9.0 1dk. internal. le@9.0 1dk. security. jgss@9.0 java. sql@9.0 Jdk. internal. opt@9.0 1dk. snmp@9.0 java. sql. rowset@9.0 jdk. jartool@9.0 1dk. xml. bind@9.0 java. transaction@9.0 jdk. javadoc@9.0 Jdk. xml. dom@9.0 java. xml@9.0 jdk. javaws@9.0 jdk. xml. ws@9.0 java. xml. bind@9.0 jdk. jcmd@9.0 jdk. zipfs@9.0
  18. 18. FXDemo ' D ' I Label I public class FXDemo extends Application { @Override ‘ V - ‘ public void start(Stage stage} { g T Label label. = new Label("Label"); StackPane root = new StackPane(label); Scene scene = new Scene(root); . stage. setScehe(scene); astagelsetTitle("FXDemo"); Istagelshow(); } public static void main(Strings. l args) { I launch(args)§ }
  19. 19. > jdeps -s fxdemo. jar fxdemo. jar fxdemo. jar FXDemo ‘ D X Label fxdemo. jar —> java. base —> javafx. controls -> javafx. graphics
  20. 20. FXDemo ' D 2 Label > jdeps fxdemo. jar fxdemo. jar —> java. base fxdemo. jar -> javafx. controls fxdemo. jar -> javafx. graphics <unnamed> (fxdemo. jar) -> java. lang -> javafx. application —> javafx. scene -> javafx. scene. control -> javafx. scene. layout -> javafx. scene. text —> javafx. stage
  21. 21. JLINK Make Custom JRE C: > jlink -—modulepath mods; "%JDK_HOME%jmods" --addmods fxdemo javafx. controls javafx. graphics ——output fxdemo
  22. 22. JLINK Make Custom JRE C: > jlink -—modulepath mods; "%JDK_HOM %jmods" --addmods fxdemo javafx. controls javafx. graphics --output fxdemo C: fxdemobin> java —listmods fxdemo@1.0 java. prefs@9.0 java. base@9.0 java. rmi@9.0 java. datatransfer@9.@ java. security. sasl@9.@ java. desktop@9.0 java. xml@9.0 java. instrument@9.0 javafx. base@9.0 java. logging@9.0 javafx. controls@9.@ java. management@9.0 javafx. graphics@9.0 java. naming@9.0 jdk. jfr@9.0
  23. 23. PROJECT KULLA Robert Field
  24. 24. .- 5*‘ R 7 ‘ . J "- I . ”r". ' mafia‘-4 'u'*~ ‘ 1/ W Robert Field PROJECT KULLA V
  25. 25. JSHELL REPL Tool for Java > jshell | welcome to Jshell -- Version 9-ea | Type / help for help -> 1+2 | Expression value is: 3 | assigned to temporary variable $1 of type int -> int a = 10 I | Added variable a of type int with initial value 10 -> printf("%d", a) 10 ->
  26. 26. V» j Michael J Mcmahon NEW HTTP CLIENT
  27. 27. HTTP Client HTTP/2 WebSocket Async
  28. 28. HTTP Client HttpResponse resp = HttpRequest . create(new URI(” http: //www. foo. com/ ” )) . GET() . response(); if (resp. statusCode() = = 200) { String responseBody = resp. body(HttpResponse. asString()); System. out. println(responseBody); }
  29. 29. HTTP Client HttpResponse resp = HttpRequest . create(new URI( “http: //www. foo. com/ ” )) . body(HttpRequest. fromString( “param1=1,param2=2” )) . POST() . response();
  30. 30. HTTP Client CompletableFuture<HttpResponse> cf = HttpRequest. create(uri) . GET() - ~ -‘ A —T. a'es§3fsc“sy: :(); HttpResponse resp = cf. join();
  31. 31. HTTP Client Httpclient client = HttpClient. create() . proxy(ProxySelector. of( new InetSocketAddress(address, 80))) . build(); CompletableFuture<webSocket> f ‘ = new webSocket. Builder(url, client) . subprotocols("proto") aheader("Foo", "foovalue") . header("Bar", "barvalue") . buildAsync(); f. join();
  32. 32. PROJECT VALHALLA
  33. 33. Walls of CPU Performance Light Speed
  34. 34. Memory is the New Disk by Brian Goetz
  35. 35. 2 Core 10 3 Register 1CLK 102KB L1 ~ 3CLK 103KB ~ 15cLK 104” SKB II BUS ~ ZOOCLK
  36. 36. Avoid Cache Miss Locate Related Data Near
  37. 37. Project Valhalla Value Type Specialization
  38. 38. class Point { final int X; final int y; }
  39. 39. Point[] pts = Header
  40. 40. Header Point[] pts = Header J x Y * [ Header * x Y . ——{ Header x Y
  41. 41. int[] x = Header
  42. 42. Point[] pts = Header
  43. 43. Point[] pts = Header Value Type
  44. 44. value class Point { final int X; final int y; } Value Type
  45. 45. Primitive Type Value Type Complex Num Big Num Vector Tuple Reference Type
  46. 46. value class OptionalInt { private final int t;
  47. 47. class Box<T> { private final T t; public Box(T t) { this. t = t; } public T get() { return t; } }
  48. 48. > javap -c -l Box class Box extends javallangaObject{ private final java lang Object t; public Box(java lang Object); Code: public java lang Object get(); Code: 0: aload_0 1: getfield #2; / /Field t: Ljava/ lang/ Object; 4: areturn
  49. 49. public class Test { public static void main(String. ., args) { Box<Integer> box = new Box<>(10); Integer number = box. get(); } } I T l» fi % public class Test { public static void main(String. ., args) { Box box = new Box(Integerevalue0f(10)); Integer number = (Integer)box. get(); } }
  50. 50. Java Generics Type Erasure Method Type Parameter java. |ang. Object Primitive Type
  51. 51. Prmitive Wrapper Class Integer, Double et al. Autoboxing Autounboxing Expensive Computation
  52. 52. Specialization Box<int> box = new Box<>(10);
  53. 53. class Box<T> { private final T t; public Box(T t) { } } this. t = t3 public T get() { } return t; class Box { } private final public Box( this. t = } public return t; } t3
  54. 54. class Box{T= int} { private final int t; public Box(int t) { this. t = t; } public int get() { return t; } }
  55. 55. public javaalang. Object*T get(); Code: 0: aload_@ 1: getfield #2; / /Field t: LObject*T; 4: areturn*T f Tfi'TTTT T T T “ 'TTTT public int get(); Code: 0: aload_@ 1: getfield #2; / /Field tzint; 4: ireturn
  56. 56. Dark History lntStream lntFunction Optionallnt
  57. 57. Dark Historyw
  58. 58. Issues Assumption of Ref. Type T[] array = (T[])new Object[n]; from ArrayList Ref. - Primitive Overloading List#remove(int index); List#remove(Object o); Null
  59. 59. CONCLUSION Project Project HTTP Project Jigsaw Kulla Client Valhalla
  60. 60. CONCLUSION lTpro JavaOne 2015 Report No.1 2016 flilfilllfi Java I: J:<‘f572£Z> No.2 SE B %’e“0‘7". : Project Jigsaw No.3 Java ’C‘ REPL 2: _ New HTTP Cllent http: //itpro. nikkeibp. co. jp/ atcl/ column/15/120700278/
  61. 61. 3 . ~Ia‘vaOne P 1 ~ Java SE ; n Java in the Box Yuichi Sakuraba

×