Daftar sistematis dari semua fitur Java dan JVM di Java 8-15

Pembaruan terakhir:  09/29/2020, termasuk perubahan pada  JDK 15  .

Dari rilis versi 8 hingga versi 15, Java telah menghasilkan 163  Proposal Ekstensi JDK  (JEP), yang masing-masing membawa beberapa perbaikan pada platform. Halaman ini adalah   daftar perbaikan terpenting yang sistematis  dan  dikurasi dengan cermat .

Kandungan

  • Fitur bahasa baru

  • API baru

  • -

  • Javadoc

JEP - OpenJDK   jdk  jdk9 .

, , :

  •    , .  , .     .

  •   .  .

  •    API    .

Java 8 , .  , .

, .  .   , Java 8 .

  • JDK 15 (   JDK 14  JDK 13 )

    String html = """
                <html>
                    <body>
                        <p>Hello, world</p>
                    </body>
                </html>
                """;
  • (Sealed) , (   )

    JDK 15

    public abstract sealed class Shape
        permits Circle, Rectangle {...}
    
    public class Circle extends Shape {...} // OK
    public class Rectangle extends Shape {...} // OK
    public class Triangle extends Shape {...} // Compile error
    
    // No need for default case if all permitted types are covered
    double area = switch (shape) {
        case Circle c    -> Math.pow(c.radius(), 2) * Math.PI
        case Rectangle r -> r.a() * r.b()
    };
  • (Records )

    JDK 15 JDK 14

    record Point(int x, int y) { }
  • instanceof ( )

    JDK 15 JDK 14

    if (obj instanceof String s) {
        System.out.println("obj is a String and it' length is " + s.length());
    }
  • Switch

    JDK 14 ( JDK 12 JDK 13)

    int numLetters = switch (day) {
        case MONDAY, FRIDAY, SUNDAY -> 6;
        case TUESDAY                -> 7;
        default      -> {
          String s = day.toString();
          int result = s.length();
          yield result;
        }
    };
  • NullPointerExceptions, , null

    JDK 15-XX:+ShowCodeDetailsInExceptionMessages JDK 14 )

    a.b.c.i = 99;
    ---
    Exception in thread "main" java.lang.NullPointerException:
          Cannot read field "c" because "a.b" is null
  • var,

    JDK 11 ( JDK 10 )

    var greeting = "Hello World!";
  • ,  ClassDefNotFoundErrors API

    JDK 9 (Project Jigsaw)

    module hu.advancedweb.helloworld {
        requires hu.advancedweb.somedependency;
        exports hu.advancedweb.hello
    }


  • JDK 9 ( Milling Coin)

  • Diamond

    JDK 9 ( Milling Coin)

  • Try-with-resources, final 

    JDK 9 ( Milling Coin)

  • @SafeVargs private 

    JDK 9 ( Milling Coin)

  • import

    JDK 9

API

Java, , .

API Java 8 14, AdoptOpenJDK / jdk-api-diff GitHub .

  • (Non-Volatile Mapped Byte Buffers) API- FileChannel

    JDK 14

  • Files.mismatch:

    JDK 12

  • Collectors.teeing ,

    JDK 12

  • :  indent transform

    JDK 12

  • HTTP- HTTP/2, WebSocket API

    JDK 11 ( Incubator  JDK 9 )

    HttpClient httpClient = HttpClient.newBuilder().build();
    
    HttpRequest request =
      HttpRequest.newBuilder()
        .uri(URI.create("https://advancedweb.hu/"))
        .GET()
        .build();
    
    HttpResponse<String> response =
      httpClient.send(request, BodyHandlers.ofString());
  • - : isBlanklinesrepeat strip

    JDK 11

  • (Factory Methods)  ,

    JDK 9

    Set<Integer> mySet = Set.of(1, 2, 3);
    List<Integer> myList = List.of(1, 2, 3);
    Map<String, Integer> myMap = Map.of("one", 1, "two", 2);
  • Reactive Streams, - « » (backpressure)1

    JDK 9

  • CompletableFuture(-, )

    JDK 9

  • dropWhiletakeWhile) ( iterateofNullable) ;  ( toUnmodifiableList); 

    JDK 9

  • Arrays.mismatch:  

    JDK 9

  • Stack-Walking API,

    JDK 9

  • API (, , , , / ), ProcessBuilder 

    JDK 9

  • VarHandleAPI , , java.util.concurrent.atomic sun.misc.Unsafe , , .

    JDK 9

  • (combinators) (lookup)  MethodHandle

    JDK 9

  • @Deprecated  forRemoval, .

    JDK 9

  • OASIS Standard XML Catalog API XML

    JDK 9

  • JDK XML Xerces 2.11.0

    JDK 9

  • TIFF Image I/O Framework

    JDK 9

  • Unicode 10.0, 27000 , 10 30

    JDK 11 ( Unicode 8.0  JDK 9 )

  • java.util.Locale API , .

    JDK 10

  • ResourceBundle UTF-8 ISO-8859-1

    JDK 9

  • CLDR (Common Locale Data Repository) 

    JDK 9

  • , //

    JDK 9

  • MultiResolutionImage DPI

    JDK 9

  • HiDPI Windows Linux

    JDK 9

  • GTK 3 Linux JavaFX, Swing AWT

    JDK 9

  •   Javadoc @beaninfo @BeanInfo Swing

    JDK 9

  • GStreamer, JavaFX / Media, 1.4.4

    JDK 9

  • ICU OpenType HarfBuzz

    JDK 9

  • API (  )

    JDK 15 JDK 14

  • Java-

    JDK 13

  • Java.

    JDK 10

  • , " "

    JDK 12

  • ,    Latin-1

    JDK 9

  • ,

    JDK 9

  • (Interned)

    JDK 9

  •   java.lang.Math sincos log AArch64

    JDK 11

  • Security Manager

    JDK 9

  • Spin-Wait Hint ( Thread#onSpinWait) «-»

    JDK 9

  • Marlin Renderer Java 2D Pisces

    JDK 9

  • GHASH RSA SPARC Intel x64

    JDK 9.

  • Thread-Local Handshakes ( )

    JDK 10

  •   

    JDK 9

  • ,  java.util.concurrent

    JDK 9

  •    Linux (  )

    JDK 10 (Graal JIT-) JDK 9 ( JVM-) JDK 9 (Graal AoT-)

  • javac:

    JDK 9

G1 ( )

  • NUMA

    JDK 14



  • JDK 12



  • JDK 12

  •   

    JDK 10

  • G1 Parallel GC

    JDK 9

  • Z Garbage Collector,

    JDK 15 (   JDK 14 (Windows) JDK 14 (OS X) JDK 11 (Linux))

  • Shenandoah, , ZGC,

    JDK 15 (  JDK 12)

  • Epsilon, ,

    JDK 11

  • XX:AllocateHeapAt=&lt;path>

    JDK 10

  • Flight Recorder:  API ,

    JDK 14

  • Microbenchmark Suite JMH

    JDK 12

  • Flight Recorder OpenJDK

    JDK 11

  • JMTI

    JDK 11

  • C1 C2,

    JDK 9

  • , JVM

    JDK 9 ( JVM) JDK 9 ( )



  • JDK 9

  • (CA) JDK, TLS

    JDK 10



  • JDK 9

  • - PKCS12 JKS

    JDK 9.

  • DRBGSecureRandom

    JDK 9  

  • X.509 SHA-1

    JDK 9

  • - SHA-3

    JDK 9

TLS

  • TLS 1.3

    JDK 11

  • Datagram Transport Layer Security (DTLS) API

    JDK 9

  • OCSP TLS

    JDK 9

  • TLS Application-Layer Protocol Negotiation (ALPN) Extension, ; ALPN HTTP/ 2

    JDK 9

  • (EdDSA) - RFC8032

    JDK 15

  • Curve25519 Curve448

    JDK 11

  • ChaCha20 Poly1305

    JDK 11

  • ,  shebang(#!)   Unix

    JDK 11

  • jshell: Java REPL

    JDK 9 (Project Kulla)

    → :  JShell

  •  --release,  --source --target

    JDK 9

  • JVM

    JDK 9

  • Packaging Tool, : msi, exe, pkg, dmg, deb rpm ( Incubator )

    JDK 14

  • jlink Java, Java, JDK

    JDK 9 - [ 2 ], [ 3 ], [ 4 ], [ 4 ], [ 5 ]

  • JAR , Java

    JDK 9

Javadoc

  • Javadoc HTML5 ,

    JDK 9 - [ 2 ], [ 3 ]

-

  •  Unsafe::defineAnonymousClass() Lookup::defineHiddenClass(), , , . 

    JDK 15

  • java.lang.invoke.constant, (  ldc), ,

    JDK 12

  • CONSTANT_Dynamic , ,  INVOKEDYNAMIC

    JDK 11

  • Nest, - , - -.

    JDK 11

  • -, , invokedynamic  StringBuilder#append . -.

    JDK 9

  • INVOKEDYNAMIC  /

    JDK 9

  • Linux / AArch64

    JDK 9

  • Linux / s390x

    JDK 9

  • Unified arm32/arm64

    JDK 9

  • Nashorn Javascript Engine  jjs

    JDK 15 (  JDK 11 )

  • Solaris SPARC

    JDK 15 (  JDK 14 )

  •  RMI Activation ( RMI),  java.rmi.activation  rmid, Java RMI

    JDK 15

  • Biased Locking ( )  ,

    JDK 15

  •  Unsafe::defineAnonymousClass()

    JDK 15

  • Concurrent Mark Sweep (CMS)

    JDK 14

  • ParallelScavenge + SerialOld GC

    JDK 14

  • Pack200 API

    JDK 14

  • Pack200 API

    JDK 11

  • Java EE

    JDK 11

  • CORBA

    JDK 11

  • Thread#destroy Thread#stop

    JDK 11

  • var

    JDK 10

  • javah

    JDK 10



  • JDK 9

  • API ( sun.*)

    JDK 92 ]

  • apple.applescript com.apple

    JDK 9

  • X.509 SHA-1

    JDK 9

  • JRE : JRE-Version  -version: cli

    JDK 9

  • jhat

    JDK 9

  • JVM TI hprof Agent

    JDK 9

  • GC, JDK 8

    JDK 9

  • ResourceBundle UTF-8 ISO-8859-1

    JDK 9

  • API

    JDK 9

  •  Concurrent Mark Sweep Garbage Collector

    JDK 9

  •  Object.finalize()

    JDK 9

  •   ( lib/endorsed) ( lib/ext) JRE

    JDK 9

  • rt.jar JRE

    JDK 9

API Java 8 14,  Java Almanac .   jdeps, Java, , API.

JDK 8  dirilis pada 2014. Kami harus menunggu  JDK 9 selama  tiga setengah tahun. Tapi segalanya berjalan lebih cepat sejak itu. Java memiliki struktur rilis baru yang bertujuan untuk merilis versi baru setiap enam bulan.

Meskipun Java 8 masih didukung, peningkatan ke versi terbaru membawa banyak peningkatan pada tabel.




All Articles