Prettier-Java 2.10.4
Input:
import module java.base; // JEP 511, final in Java 25
public class Main {
public static void main(String[] args) {
List<String> messages = List.of("Hello", "World");
System.out.println(messages);
}
}
Output:
import java.base; // JEP 511, final in Java 25
public class Main {
public static void main(String[] args) {
List<String> messages = List.of("Hello", "World");
System.out.println(messages);
}
}
Expected behavior:
Output should be the same as Input.
Java code in Input runs successfully when using JDK 25 and prints to console:
Java code in Output doesn't run when using JDK 25, because module keyword was removed, exception is:
Main.java:1: error: cannot find symbol
import java.base; // JEP 511, final in Java 25
^
symbol: class base
location: package java
Main.java:6: error: cannot find symbol
List<String> messages = List.of("Hello", "World");
^
symbol: class List
location: class Main
Main.java:6: error: cannot find symbol
List<String> messages = List.of("Hello", "World");
^
symbol: variable List
location: class Main
3 errors
error: compilation failed
This refers to JEP 511: Module Import Declarations, which is finalized in Java 25.
Prettier-Java 2.10.4
Input:
Output:
Expected behavior:
Output should be the same as Input.
Java code in Input runs successfully when using JDK 25 and prints to console:
Java code in Output doesn't run when using JDK 25, because
modulekeyword was removed, exception is:This refers to JEP 511: Module Import Declarations, which is finalized in Java 25.