====== Java 9 ====== * [[java:9:module|Java 9 Module]] * [[http://www.javacodegeeks.com/2015/06/5-features-in-java-9-that-will-change-how-you-develop-software-and-2-that-wont.html|5 Features in Java 9 that WILL Change How You Develop Software (and 2 That Won’t) | Java Code Geeks]] * [[https://www.sitepoint.com/ultimate-guide-to-java-9/|Ultimate Guide To Java 9]] ===== Collection Factory Methods ===== * ''Set.of'', ''List.of'', ''Map.of'' * 완전한 immutable 컬렉션을 만들어준다. * ''null'' 값을 넣을 수 없게 방어해준다. * ''Set'',''Map'' 은 중복값을 넣는 경우에도 오류를 발생시켜 방어해준다. * 컬렉션 크기가 명확하게 정해지기 때문에 공간 최적화가 된다. * ''Collections.unmodifiableXxx'' * 원본 컬렉션에 추가, 삭제 등이 일어나면 ''unmodifiable'' 컬렉션에 이 값이 반영된다. 즉, 완벽한 immutable 이 아니다. * null 값을 넣을 수 있다. ===== G1 GC ===== * [[java:g1gc|Java G1 GC]]가 기본 Garbage Collector 가 된다. ===== Compact Strings ===== * 원래 ''String''은 ''char []''로 표현되고 ''char''는 UTF-16 으로 2byte 를 차지했다. * Java 9 에서는 ''byte[]'' 로 저장하여 1byte 단위로 공간을 차지하게 최적화 하였다. * ''Latin-1'' 문자로 이루어진 경우에는 ''coder'' 라는 ''String'' 의 내부 변수를 ''LATIN1''으로 설정하여 1 바이트 단위로 읽고 * ''UTF-16''일 경우에는 ''coder'' 값을 ''UTF_16'' 으로 설정하고 2 바이트 단위로 읽는다. * ''StringBuilder''와 ''StringBuffer''에도 최적화가 반영되어있다. * Memory 사용량이 줄고 줄고 그로인해 GC도 적어지고 성능이 좋아졌다. ===== String Concat 개선 ===== * Java 8 에서는 문자열 연속 연결시에 자동으로 ''StringBuilder''로 만들어주었었으나 이 경우 ''StringBuilder''의 기본 버퍼 크기를 사용하면서 버퍼 크기 부족시 성능저하가 있을 수 있음. * Java 9 는 문자열 연속 ''+'' 연산시 ''invokeDynamic''으로 ''StringBuilder''를 동적으로 최적화 해서 호출한다. * 따라서 연속적인 문자열 ''+'' 연결은 그냥 ''+''를 사용하는게 훨씬 빠르다. 물론 Java 9 이상을 target 으로 컴파일해야 한다. > "+ is no longer compiled to StringBuilder." In their "Lessons from Today" slide, they state, "Use + instead of StringBuilder where possible" and "recompile classes for Java 9+." * [[http://marxsoftware.blogspot.com/2019/01/jep-280-indify-string-concatenations.html|Inspired by Actual Events: JDK 9/JEP 280: String Concatenations Will Never Be the Same]] * [[https://www.javaspecialists.eu/talks/pdfs/2018%20Voxxed%20in%20Thessaloniki,%20Greece%20-%20%22Enough%20java.lang.String%20to%20Hang%20Ourselves%20...%22%20by%20Heinz%20Kabutz.pdf|2018 Voxxed in Thessaloniki, Greece - "Enough java.lang.String to Hang Ourselves ..." by Heinz Kabutz]] * [[https://dzone.com/articles/concatenating-strings-in-java-9|Concatenating Strings in Java 9 - DZone Java]] ===== 참고 ===== * [[http://www.slideshare.net/duriepark/java9-65665865|Java9 특징 훑어보기]] * [[https://medium.com/@goinhacker/java-9%EC%9D%98-%EB%B3%80%ED%99%94%EC%99%80-%ED%8A%B9%EC%A7%95-%EB%8C%80%EC%B6%A9-%EC%A0%95%EB%A6%AC-fca77cee88f2|Java 9의 변화와 특징 대충 정리 – 디지털 세상을 만드는 아날로거 – Medium]] * [[https://www.logicbig.com/tutorials/core-java-tutorial/modules.html|Java 9 Module System]] * [[https://www.logicbig.com/tutorials/core-java-tutorial/java-9-changes.html|Java 9 Features]] * [[https://www.logicbig.com/tutorials/core-java-tutorial/jshell.html|Java 9 JShell]] * [[https://www.baeldung.com/new-java-9|Java 9 New Features | Baeldung]] * [[https://examples.javacodegeeks.com/core-java/java-9-new-features-tutorial/|Java 9 New Features Tutorial | Examples Java Code Geeks - 2017]] * [[https://www.sitepoint.com/inside-java-9-part-i/|Inside Java 9 - Part I]] * [[http://www.javaworld.com/article/3164262/java-language/java-9s-other-new-enhancements-part-1.html|Java 9's other new enhancements, Part 1: Factory methods in Java Collections | JavaWorld]] * [[http://www.javaworld.com/article/3169388/java-language/java-9s-other-new-enhancements-part-2.html|Java 9's other new enhancements, Part 2: Milling Project Coin | JavaWorld]] * [[http://www.baeldung.com/java-9-process-api|Java 9 Process API Improvements | Baeldung]] * [[http://www.baeldung.com/java-9-repl|Java 9 - Exploring the REPL | Baeldung]] * [[http://blog.joda.org/2017/02/java-time-jsr-310-enhancements-java-9.html|Stephen Colebourne's blog: Java Time (JSR-310) enhancements in Java SE 9]] * [[https://www.sitepoint.com/deep-dive-into-java-9s-stack-walking-api/|Deep Dive into Java 9's Stack-Walking API — SitePoint]] * [[http://blog.joda.org/2017/04/java-9-modules-jpms-basics.html|Stephen Colebourne's blog: Java 9 modules - JPMS basics]] * [[https://dzone.com/articles/java-9-besides-modules|What's New in Java 9? (Besides Modules) - DZone Java]] * [[https://dzone.com/articles/jdk9-execute-java-code-like-unix-shell-script|JDK9: Execute Java Code Like Unix Shell Script]] * [[https://www.javacodegeeks.com/2017/07/java-9-migration-guide-seven-common-challenges.html|Java 9 Migration Guide: The Seven Most Common Challenges]] * [[http://blog.takipi.com/everything-you-need-to-know-about-java-9/|Everything You Need to Know About Java 9 | Takipi Blog]] * [[https://www.oracle.com/java/java9-screencasts.html|Java 9 | Expert Insights | Oracle]] * [[http://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-7744EF96-5899-4FB2-B34E-86D49B2E89B6|Java Platform, Standard Edition Oracle JDK 9 Migration Guide, Release 9]] * [[https://dzone.com/articles/my-top-java-9-features|My Top Java 9 Features - DZone Java]] * [[https://aboullaite.me/java-9-process-api-got-a-new-boost/|Java 9: Process API got a new boost!]] * [[https://www.javacodegeeks.com/2017/12/java-9-enhancements-optional.html|Java 9: Enhancements to Optional]] * [[https://www.javacodegeeks.com/2017/12/java-9-enhancements-stream-api.html|Java 9: Enhancements to the Stream API]] * [[https://www.javacodegeeks.com/2017/12/java-9-jshell.html|Java 9: JShell]] * [[https://www.javacodegeeks.com/2018/06/infinite-sets-java.html|Infinite Sets in Java 9 | Java Code Geeks - 2018]] * [[https://www.baeldung.com/java-9-logging-api|Java 9 Platform Logging API | Baeldung]] * [[https://www.baeldung.com/java-9-stream-api|Java 9 Stream API improvements | Baeldung]] * [[https://www.baeldung.com/java-9|Java 9 | Baeldung]] * [[https://www.baeldung.com/java-9-optional|Java 9 Optional API Additions | Baeldung]] * [[https://dzone.com/articles/jdk9s-forkjoinpool-upgrades|JDK9's ForkJoinPool Upgrades - DZone Java]] * [[https://www.baeldung.com/java-9-reactive-streams|Java 9 Reactive Streams | Baeldung]] * [[https://dzone.com/articles/reactive-streams-in-java-9|Reactive Streams in Java 9 - DZone Java]] * [[https://www.journaldev.com/20723/java-9-reactive-streams|Java 9 Reactive Streams - JournalDev]] * [[https://community.oracle.com/docs/DOC-1006738|Reactive Programming with JDK 9 Flow API | Oracle Community]] * [[https://www.youtube.com/watch?v=_stAxdjx8qk|Don’t use Reactive Streams in Java 9+ - Jacek Kunicki - YouTube]] * [[https://thepracticaldeveloper.com/2018/01/31/reactive-programming-java-9-flow/|Reactive Programming with Java 9 Flow - The Practical Developer]] * [[https://aboullaite.me/reactive-streams-example-java-9/|Reactive Streams example - Java 9]] * [[https://www.baeldung.com/java-9-compact-string|Compact Strings in Java 9 | Baeldung]] * [[https://dzone.com/articles/compact-strings-in-java-9|Compact Strings in Java 9 - DZone Java]] * [[https://marxsoftware.blogspot.com/search/label/Java%209|Inspired by Actual Events: Java 9]] * [[https://www.javacodegeeks.com/2015/05/how-java-9-and-project-jigsaw-may-break-your-code-2.html|How Java 9 And Project Jigsaw May Break Your Code | Java Code Geeks - 2019]] * [[https://www.baeldung.com/java-9-http-client|Exploring the New HTTP Client in Java 9]] * [[https://openjdk.java.net/groups/net/httpclient/intro.html|Introduction to the Java HTTP Client]] * [[https://www.javadevjournal.com/java/java-9-http-client/|HTTP Client in Java 9 | Java Development Journal]] * [[https://dzone.com/articles/java-9-http-20|Java 9: HTTP/2 Improvements - DZone Java]] * [[https://devahea.github.io/2019/04/23/Java9/|JAVA8말고 JAVA9를 사용해볼까 | Ahea Team Study Blog]] * [[https://howtodoinjava.com/java9/java9-new-features-enhancements/|Java 9 Features and Enhancements - HowToDoInJava]] * [[https://blog.joda.org/2017/02/java-time-jsr-310-enhancements-java-9.html|Stephen Colebourne's blog: Java Time (JSR-310) enhancements in Java SE 9]] * [[https://www.baeldung.com/java-9-collections-factory-methods|Java 9 Convenience Factory Methods for Collections | Baeldung]] * [[https://www.baeldung.com/java-9-completablefuture|Java 9 CompletableFuture API Improvements | Baeldung]] * [[https://grokonez.com/java/java-9-completablefuture-api-improvements-delay-timeout-support|Java 9 CompletableFuture API Improvements - Delay and Timeout Support » grokonez]] * [[https://www.codingame.com/playgrounds/46649/java-9-improvements/completablefuture-improvements|CompletableFuture Improvements - Java 9 Improvements]] * [[https://www.tutorialspoint.com/java9/java9_completablefuture_api_improvements.htm|CompletableFuture API Improvements - Tutorialspoint]] ===== Resourcebundle UTF-8 ===== * [[https://docs.oracle.com/javase/9/intl/internationalization-enhancements-jdk-9.htm#JSINT-GUID-974CF488-23E8-4963-A322-82006A7A14C7|Internationalization Enhancements in JDK 9]] * 기본적으로 ''UTF-8''로 [[https://docs.oracle.com/javase/9/docs/api/java/util/ResourceBundle.html|ResourceBundle]]에서 ''*.properties'' 파일을 로딩함. * 만약 인위적으로 기존 ''ISO-8859-1''로 명시하고자 한다면 * [[https://docs.oracle.com/javase/9/docs/api/java/util/PropertyResourceBundle.html|PropertyResourceBundle (Java SE 9 & JDK 9 )]] java.util.PropertyResourceBundle.encoding=ISO-8859-1 * [[https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Properties.html|Properties]] 는 기본 ''ISO-8859-1'' 이고, 명시적으로 Reader 인코딩을 ''UTF-8''로 지정해야만 한다.