mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-11 12:19:00 +00:00
[pretty][jdk25] Pretty printer now supports module imports; also: test that confirms this.
This commit is contained in:
3 files changed
+19
No files matched your search
@@ -514,6 +514,14 @@ public class PrettyPrinter extends JCTree.Visitor {
|
||||
println(";", tree);
|
||||
}
|
||||
|
||||
void printModuleImport(JCTree tree) {
|
||||
JCExpression qualid = readObject(tree, "module", null);
|
||||
|
||||
aPrint("import module ");
|
||||
print(qualid);
|
||||
println(";", tree);
|
||||
}
|
||||
|
||||
private Name currentTypeName;
|
||||
@Override public void visitClassDef(JCClassDecl tree) {
|
||||
println();
|
||||
@@ -1710,6 +1718,8 @@ public class PrettyPrinter extends JCTree.Visitor {
|
||||
printRecordPattern(tree);
|
||||
} else if (className.endsWith("$JCAnyPattern")) { // Introduced in JDK22
|
||||
print("_");
|
||||
} else if (className.endsWith("$JCModuleImport")) { // Introduced in JDK25
|
||||
printModuleImport(tree);
|
||||
} else {
|
||||
throw new AssertionError("Unhandled tree type: " + tree.getClass() + ": " + tree);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import module java.base;
|
||||
|
||||
public class ModuleImport {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// version 25:
|
||||
|
||||
import module java.base;
|
||||
|
||||
public class ModuleImport {}
|
||||
Reference in new issue
Block a user