From 7b94c7683f926cea07f5b17152d3bc51828e250f Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sat, 26 Jul 2025 11:59:03 +0200 Subject: [PATCH 01/10] [jdk25] Print var in delombok --- src/delombok/lombok/delombok/PrettyPrinter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index 53ed4728..e8808c3c 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2024 The Project Lombok Authors. + * Copyright (C) 2016-2025 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -92,13 +92,13 @@ import com.sun.tools.javac.util.Name; import com.sun.tools.javac.util.Position; import lombok.javac.CommentInfo; -import lombok.javac.Javac; -import lombok.javac.PackageName; -import lombok.permit.Permit; import lombok.javac.CommentInfo.EndConnection; import lombok.javac.CommentInfo.StartConnection; +import lombok.javac.Javac; import lombok.javac.JavacTreeMaker.TreeTag; import lombok.javac.JavacTreeMaker.TypeTag; +import lombok.javac.PackageName; +import lombok.permit.Permit; public class PrettyPrinter extends JCTree.Visitor { private static final String LINE_SEP = System.getProperty("line.separator"); @@ -697,7 +697,7 @@ public class PrettyPrinter extends JCTree.Visitor { */ try { innermostArrayBracketsAreVarargs = varargs; - if (tree.vartype == null || tree.vartype.pos == -1) { + if (tree.vartype == null || tree.vartype.pos == -1 || endPos(tree.vartype) == -1) { print("var"); } else { print(tree.vartype); From 4e1542fc5e55eaa4074da97898b67a2758c90aca Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sat, 26 Jul 2025 11:59:50 +0200 Subject: [PATCH 02/10] [jdk25] Add new modifier flag for sealed classes --- src/utils/lombok/javac/Javac.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java index 22edcd05..ed9fc3ab 100644 --- a/src/utils/lombok/javac/Javac.java +++ b/src/utils/lombok/javac/Javac.java @@ -82,7 +82,7 @@ public class Javac { public static final long COMPACT_RECORD_CONSTRUCTOR = 1L << 51; // MethodSymbols (the 'implicit' many-args constructor that records have) public static final long UNINITIALIZED_FIELD = 1L << 51; // VarSymbols (To identify fields that the compact record constructor won't initialize) public static final long GENERATED_MEMBER = 1L << 24; // MethodSymbols, VarSymbols (marks methods and the constructor generated in records) - public static final long SEALED = 1L << 62; // ClassSymbols (Flag to indicate sealed class/interface declaration) + public static final long SEALED = 1L << 62 | 1L << 48; // ClassSymbols (Flag to indicate sealed class/interface declaration) public static final long NON_SEALED = 1L << 63; // ClassSymbols (Flag to indicate that the class/interface was declared with the non-sealed modifier) /** From 39361edfc802dd4aa330038991f3c113b1e67e55 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sat, 26 Jul 2025 12:05:33 +0200 Subject: [PATCH 03/10] [jdk25] Fix support for generated warnings --- src/core/lombok/javac/JavacAST.java | 38 ++++++++++------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java index 215a2110..49ca2a54 100644 --- a/src/core/lombok/javac/JavacAST.java +++ b/src/core/lombok/javac/JavacAST.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2020 The Project Lombok Authors. + * Copyright (C) 2009-2025 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,6 +41,7 @@ import lombok.core.CleanupRegistry; import lombok.core.CleanupTask; import lombok.permit.Permit; +import com.sun.tools.javac.code.Lint.LintCategory; import com.sun.tools.javac.code.Source; import com.sun.tools.javac.code.Symtab; import com.sun.tools.javac.model.JavacElements; @@ -581,9 +582,6 @@ public class JavacAST extends AST { case ERROR: errorLogger.error(pos, message); break; - case MANDATORY_WARNING: - errorLogger.mandatoryWarning(pos, message); - break; case WARNING: errorLogger.warning(pos, message); break; @@ -658,14 +656,8 @@ public class JavacAST extends AST { warning1(pos, message); } - final void mandatoryWarning(DiagnosticPosition pos, String message) { - increment(warningCount); - mandatoryWarning1(pos, message); - } - abstract void error1(DiagnosticPosition pos, String message); abstract void warning1(DiagnosticPosition pos, String message); - abstract void mandatoryWarning1(DiagnosticPosition pos, String message); abstract void note(DiagnosticPosition pos, String message); private void increment(Field field) { @@ -689,7 +681,6 @@ public class JavacAST extends AST { for (Field field : log.getClass().getFields()) { if (field.getName().equals("multipleErrors")) { hasMultipleErrors = true; - break; } } if (hasMultipleErrors) return new JdkBefore9(log, messager, errorCount); @@ -723,10 +714,6 @@ public class JavacAST extends AST { log.warning(pos, "proc.messager", message); } - @Override void mandatoryWarning1(DiagnosticPosition pos, String message) { - log.mandatoryWarning(pos, "proc.messager", message); - } - @Override void note(DiagnosticPosition pos, String message) { log.note(pos, "proc.messager", message); } @@ -735,7 +722,7 @@ public class JavacAST extends AST { static class Jdk9Plus extends ErrorLog { private static final String PROC_MESSAGER = "proc.messager"; private Object multiple; - private Method errorMethod, warningMethod, mandatoryWarningMethod, noteMethod; + private Method errorMethod, warningMethod, noteMethod; private Method errorKey, warningKey, noteKey; private JCDiagnostic.Factory diags; @@ -756,7 +743,6 @@ public class JavacAST extends AST { Class lc = log.getClass(); this.errorMethod = Permit.getMethod(lc, "error", df, DiagnosticPosition.class, errorCls); this.warningMethod = Permit.getMethod(lc, "warning", DiagnosticPosition.class, warningCls); - this.mandatoryWarningMethod = Permit.getMethod(lc, "mandatoryWarning", DiagnosticPosition.class, warningCls); this.noteMethod = Permit.getMethod(lc, "note", DiagnosticPosition.class, noteCls); Field diagsField = Permit.getField(lc.getSuperclass(), "diags"); @@ -764,7 +750,10 @@ public class JavacAST extends AST { Class dc = this.diags.getClass(); this.errorKey = Permit.getMethod(dc, "errorKey", String.class, Object[].class); - this.warningKey = Permit.getMethod(dc, "warningKey", String.class, Object[].class); + this.warningKey = Permit.permissiveGetMethod(dc, "warningKey", String.class, Object[].class); + if (warningKey == null) { + this.warningKey = Permit.getMethod(dc, "warningKey", LintCategory.class, String.class, Object[].class); + } this.noteKey = Permit.getMethod(dc, "noteKey", String.class, Object[].class); } catch (Throwable t) { //t.printStackTrace(); @@ -778,16 +767,15 @@ public class JavacAST extends AST { @Override void warning1(DiagnosticPosition pos, String message) { - Object warning = Permit.invokeSneaky(this.warningKey, diags, PROC_MESSAGER, new Object[] { message }); + Object warning; + if (this.warningKey.getParameterTypes().length == 3) { + warning = Permit.invokeSneaky(this.warningKey, diags, null, PROC_MESSAGER, new Object[] { message }); + } else { + warning = Permit.invokeSneaky(this.warningKey, diags, PROC_MESSAGER, new Object[] { message }); + } if (warning != null) Permit.invokeSneaky(warningMethod, log, pos, warning); } - @Override - void mandatoryWarning1(DiagnosticPosition pos, String message) { - Object warning = Permit.invokeSneaky(this.warningKey, diags, PROC_MESSAGER, new Object[] { message }); - if (warning != null) Permit.invokeSneaky(mandatoryWarningMethod, log, pos, warning); - } - @Override void note(DiagnosticPosition pos, String message) { Object note = Permit.invokeSneaky(this.noteKey, diags, PROC_MESSAGER, new Object[] { message }); From 9339cc00e8ac11fe738e7eb3c7695e9eee84b9fd Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sat, 26 Jul 2025 12:08:18 +0200 Subject: [PATCH 04/10] [jdk25] Add JDK 25 to test workflow --- .github/workflows/ant.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index 7552c536..390375d2 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -41,10 +41,10 @@ jobs: runs-on: ubuntu-24.04 needs: build env: - EA_JDK: 24 + EA_JDK: 25 strategy: matrix: - jdk: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] + jdk: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25] goal: [javacCurrent] include: - jdk: 11 From 98f6b5f27f6b63900646a3665d8a99fe3a086110 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 31 Jul 2025 22:50:31 +0200 Subject: [PATCH 05/10] [trivial][style] --- src/core/lombok/javac/JavacAST.java | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java index 49ca2a54..9504bc4a 100644 --- a/src/core/lombok/javac/JavacAST.java +++ b/src/core/lombok/javac/JavacAST.java @@ -416,7 +416,6 @@ public class JavacAST extends AST { JCANNOTATEDTYPE_FIELDS_INITIALIZED = true; } - private static Field JCENHANCEDFORLOOP_VARORRECORDPATTERN_FIELD = Permit.permissiveGetField(JCEnhancedForLoop.class, "varOrRecordPattern"); private static JCTree getVarOrRecordPattern(JCEnhancedForLoop loop) { if (JCENHANCEDFORLOOP_VARORRECORDPATTERN_FIELD == null) { @@ -594,7 +593,7 @@ public class JavacAST extends AST { if (newSource != null) errorLogger.useSource(oldSource); } } - + public void removeFromDeferredDiagnostics(int startPos, int endPos) { JCCompilationUnit self = (JCCompilationUnit) top().get(); new CompilerMessageSuppressor(getContext()).removeAllBetween(self.sourcefile, startPos, endPos); @@ -641,21 +640,21 @@ public class JavacAST extends AST { this.errorCount = errorCount; this.warningCount = warningCount; } - + final JavaFileObject useSource(JavaFileObject file) { return log.useSource(file); } - + final void error(DiagnosticPosition pos, String message) { increment(errorCount); error1(pos, message); } - + final void warning(DiagnosticPosition pos, String message) { increment(warningCount); warning1(pos, message); } - + abstract void error1(DiagnosticPosition pos, String message); abstract void warning1(DiagnosticPosition pos, String message); abstract void note(DiagnosticPosition pos, String message); @@ -699,7 +698,7 @@ public class JavacAST extends AST { private JdkBefore9(Log log, Messager messager, Field errorCount) { super(log, messager, errorCount, null); } - + @Override void error1(DiagnosticPosition pos, String message) { boolean prev = log.multipleErrors; log.multipleErrors = true; @@ -709,11 +708,11 @@ public class JavacAST extends AST { log.multipleErrors = prev; } } - + @Override void warning1(DiagnosticPosition pos, String message) { log.warning(pos, "proc.messager", message); } - + @Override void note(DiagnosticPosition pos, String message) { log.note(pos, "proc.messager", message); } @@ -728,14 +727,14 @@ public class JavacAST extends AST { private Jdk9Plus(Log log, Messager messager, Field errorCount, Field warningCount) { super(log, messager, errorCount, warningCount); - + try { final String jcd = "com.sun.tools.javac.util.JCDiagnostic"; Class df = Class.forName(jcd + "$DiagnosticFlag"); for (Object constant : df.getEnumConstants()) { if (constant.toString().equals("MULTIPLE")) this.multiple = constant; } - + Class errorCls = Class.forName(jcd + "$Error"); Class warningCls = Class.forName(jcd + "$Warning"); Class noteCls = Class.forName(jcd + "$Note"); @@ -744,10 +743,10 @@ public class JavacAST extends AST { this.errorMethod = Permit.getMethod(lc, "error", df, DiagnosticPosition.class, errorCls); this.warningMethod = Permit.getMethod(lc, "warning", DiagnosticPosition.class, warningCls); this.noteMethod = Permit.getMethod(lc, "note", DiagnosticPosition.class, noteCls); - + Field diagsField = Permit.getField(lc.getSuperclass(), "diags"); this.diags = (JCDiagnostic.Factory) diagsField.get(log); - + Class dc = this.diags.getClass(); this.errorKey = Permit.getMethod(dc, "errorKey", String.class, Object[].class); this.warningKey = Permit.permissiveGetMethod(dc, "warningKey", String.class, Object[].class); @@ -764,7 +763,7 @@ public class JavacAST extends AST { Object error = Permit.invokeSneaky(this.errorKey, diags, PROC_MESSAGER, new Object[] { message }); if (error != null) Permit.invokeSneaky(errorMethod, log, multiple, pos, error); } - + @Override void warning1(DiagnosticPosition pos, String message) { Object warning; @@ -775,7 +774,7 @@ public class JavacAST extends AST { } if (warning != null) Permit.invokeSneaky(warningMethod, log, pos, warning); } - + @Override void note(DiagnosticPosition pos, String message) { Object note = Permit.invokeSneaky(this.noteKey, diags, PROC_MESSAGER, new Object[] { message }); From 6b2af3f81fb085b018c71e894775ef0ae2ed944c Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 31 Jul 2025 22:51:08 +0200 Subject: [PATCH 06/10] [trivial][comments] Primarily: Clarified the weird situation that both bit 62 and 48 indicate 'sealed'. It's a 'javac changing stuff between major versions' thing. --- src/delombok/lombok/delombok/PrettyPrinter.java | 2 +- src/utils/lombok/javac/Javac.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index e8808c3c..fa8eaf6d 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -1033,7 +1033,7 @@ public class PrettyPrinter extends JCTree.Visitor { if ((v & NATIVE) != 0) print("native "); if ((v & ABSTRACT) != 0) print("abstract "); if ((v & SEALED) != 0) print("sealed "); - if ((v & NON_SEALED) != 0) print("non-sealed "); + if ((v & NON_SEALED) != 0) print("non-sealed "); // Yes, this is a real keyword. if ((v & STRICTFP) != 0) print("strictfp "); if ((v & DEFAULT) != 0 && (v & INTERFACE) == 0) print("default "); } diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java index ed9fc3ab..f6dbc4da 100644 --- a/src/utils/lombok/javac/Javac.java +++ b/src/utils/lombok/javac/Javac.java @@ -77,12 +77,12 @@ public class Javac { private static final AtomicInteger compilerVersion = new AtomicInteger(-1); - /* This section includes flags that would ordinarily be in Flags, but which are 'too new' (we don't compile against older versions of javac for compatibility). */ + /* This section includes flags that would ordinarily be in com.sun.tools.javac.code.Flags, but which are 'too new' (we don't compile against older versions of javac for compatibility). */ public static final long RECORD = 1L << 61; // ClassSymbols, MethodSymbols, VarSymbols (Marks types as being records, as well as the 'fields' in the compact declaration, and the canonical constructor) public static final long COMPACT_RECORD_CONSTRUCTOR = 1L << 51; // MethodSymbols (the 'implicit' many-args constructor that records have) public static final long UNINITIALIZED_FIELD = 1L << 51; // VarSymbols (To identify fields that the compact record constructor won't initialize) public static final long GENERATED_MEMBER = 1L << 24; // MethodSymbols, VarSymbols (marks methods and the constructor generated in records) - public static final long SEALED = 1L << 62 | 1L << 48; // ClassSymbols (Flag to indicate sealed class/interface declaration) + public static final long SEALED = 1L << 62 | 1L << 48; // ClassSymbols (Flag to indicate sealed class/interface declaration) - from the introduction of sealed until ~jdk23, this was 62. In jdk24, it's 48. Ugh. public static final long NON_SEALED = 1L << 63; // ClassSymbols (Flag to indicate that the class/interface was declared with the non-sealed modifier) /** From f0e3dacf470d4d94b6de41b863172304ce016d3a Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 1 Aug 2025 00:09:00 +0200 Subject: [PATCH 07/10] [build] vm-finder no longer blindly continues if trying to find an unknown VM version: find-vm had the annoying property that on `/usr/libexec/java_home` based systems (Such as macs), trying to find the location of an unknown VM version just gave you the default, meaning `ant test.javac25` would run on 24. Now, it errors. --- buildScripts/vm-finder.ant.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildScripts/vm-finder.ant.xml b/buildScripts/vm-finder.ant.xml index 2a33b2b8..94682fa4 100644 --- a/buildScripts/vm-finder.ant.xml +++ b/buildScripts/vm-finder.ant.xml @@ -62,7 +62,7 @@ and rerun the build; this build is capable of finding VMs automatically on many - + From c2ed29308d9fe8c939240a80acf1c317725dd229 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 1 Aug 2025 00:57:37 +0200 Subject: [PATCH 08/10] [build] Added ant targets for OpenJDK 25 release. --- buildScripts/tests.ant.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/buildScripts/tests.ant.xml b/buildScripts/tests.ant.xml index 90fb89c3..1936ab88 100644 --- a/buildScripts/tests.ant.xml +++ b/buildScripts/tests.ant.xml @@ -140,24 +140,33 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn + + + + + + + + + Running TestJavac on JVM${ant.java.version}, with the javac built into your VM distributon. @@ -337,5 +346,5 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn - + From 70ac222e648ea0af82200f671a727e3165cbb5c6 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 1 Aug 2025 00:58:01 +0200 Subject: [PATCH 09/10] [pretty][jdk25] Pretty printer now supports module imports; also: test that confirms this. --- src/delombok/lombok/delombok/PrettyPrinter.java | 10 ++++++++++ test/pretty/resource/after/ModuleImport.java | 4 ++++ test/pretty/resource/before/ModuleImport.java | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 test/pretty/resource/after/ModuleImport.java create mode 100644 test/pretty/resource/before/ModuleImport.java diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index fa8eaf6d..3aef2ced 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -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); } diff --git a/test/pretty/resource/after/ModuleImport.java b/test/pretty/resource/after/ModuleImport.java new file mode 100644 index 00000000..90b7ea72 --- /dev/null +++ b/test/pretty/resource/after/ModuleImport.java @@ -0,0 +1,4 @@ +import module java.base; + +public class ModuleImport { +} diff --git a/test/pretty/resource/before/ModuleImport.java b/test/pretty/resource/before/ModuleImport.java new file mode 100644 index 00000000..782680f1 --- /dev/null +++ b/test/pretty/resource/before/ModuleImport.java @@ -0,0 +1,5 @@ +// version 25: + +import module java.base; + +public class ModuleImport {} From 39ef5d0d04e979705bda902d1a2c43e392fdcefe Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 1 Aug 2025 01:13:52 +0200 Subject: [PATCH 10/10] [jdk25] Added support for implicit classes and a test to confirm support. --- src/delombok/lombok/delombok/PrettyPrinter.java | 6 ++++++ src/utils/lombok/javac/Javac.java | 1 + test/pretty/resource/after/CompactSourceFile.java | 3 +++ test/pretty/resource/before/CompactSourceFile.java | 5 +++++ 4 files changed, 15 insertions(+) create mode 100644 test/pretty/resource/after/CompactSourceFile.java create mode 100644 test/pretty/resource/before/CompactSourceFile.java diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index 3aef2ced..ae0ce282 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -524,6 +524,12 @@ public class PrettyPrinter extends JCTree.Visitor { private Name currentTypeName; @Override public void visitClassDef(JCClassDecl tree) { + if ((tree.mods.flags & IMPLICIT_CLASS) != 0) { + printClassMembers(tree.defs, false, false); + consumeComments(endPos(tree)); + return; + } + println(); printDocComment(tree); align(); diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java index f6dbc4da..08c13cc4 100644 --- a/src/utils/lombok/javac/Javac.java +++ b/src/utils/lombok/javac/Javac.java @@ -84,6 +84,7 @@ public class Javac { public static final long GENERATED_MEMBER = 1L << 24; // MethodSymbols, VarSymbols (marks methods and the constructor generated in records) public static final long SEALED = 1L << 62 | 1L << 48; // ClassSymbols (Flag to indicate sealed class/interface declaration) - from the introduction of sealed until ~jdk23, this was 62. In jdk24, it's 48. Ugh. public static final long NON_SEALED = 1L << 63; // ClassSymbols (Flag to indicate that the class/interface was declared with the non-sealed modifier) + public static final long IMPLICIT_CLASS = 1L << 19; // ClassSymbols (Flag to indicate that the class/interface wasn't actually written out; it is an implicitly declared top-level class). Introduced in JDK25, JEP512. /** * Returns the version of this java compiler, i.e. the JDK that it shipped in. For example, for javac v1.7, this returns {@code 7}. diff --git a/test/pretty/resource/after/CompactSourceFile.java b/test/pretty/resource/after/CompactSourceFile.java new file mode 100644 index 00000000..e60d5b98 --- /dev/null +++ b/test/pretty/resource/after/CompactSourceFile.java @@ -0,0 +1,3 @@ +void main() { + IO.print("This is valid java as of JDK25"); +} diff --git a/test/pretty/resource/before/CompactSourceFile.java b/test/pretty/resource/before/CompactSourceFile.java new file mode 100644 index 00000000..7c598aca --- /dev/null +++ b/test/pretty/resource/before/CompactSourceFile.java @@ -0,0 +1,5 @@ +// version 25: + +void main() { + IO.print("This is valid java as of JDK25"); +}