Skip to content

Commit 0286d6f

Browse files
authored
Bump javac release to 11 (#10040)
Going forward, GWT builds will contain Java 11 bytecode and be able to use Java 11 language and jre improvements. The Emulation Summary doclet is left on Java 8, as setting the source level higher causes errors due to redefining classes in java.base etc.
1 parent c2229e7 commit 0286d6f

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

common.ant.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<property name="javac.debug" value="true"/>
5555
<property name="javac.debuglevel" value="lines,vars,source"/>
5656
<property name="javac.encoding" value="utf-8"/>
57-
<property name="javac.release" value="8"/>
57+
<property name="javac.release" value="11"/>
5858
<property name="javac.nowarn" value="true"/>
5959

6060
<!-- javac and errorprone instructions from https://errorprone.info/docs/installation#ant -->

dev/core/test/com/google/gwt/dev/javac/GeneratedClassnameFinderTest.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,36 +105,39 @@ public void testEnum() {
105105
assertEquals(0, new EnumTester().getGeneratedClasses().size());
106106
}
107107

108+
/**
109+
* This test requires a lot of care and feeding to keep track of which version of Java the test
110+
* classes were built with, and what the current release version is.
111+
*/
108112
public void testJavacWeirdness() {
109113
List<String> classNames = new JavacWeirdnessTester().getGeneratedClasses();
110-
if (classNames.size() == 4) {
111-
// javac8:
112-
// JavacWeirdnessTester$1
114+
if (classNames.size() == 3) {
115+
// javac 11 with --release=11:
116+
// javac 17 with --release=11:
117+
// javac 21 with --release=11:
113118
// JavacWeirdnessTester$2
114119
// JavacWeirdnessTester$2Foo
115120
// JavacWeirdnessTester$3Foo
116121
assertFalse(classNames.get(0) + " should not contain Foo",
117122
classNames.get(0).contains("Foo"));
118-
assertFalse(classNames.get(1) + " should not contain Foo",
119-
classNames.get(1).contains("Foo"));
123+
assertTrue(classNames.get(1) + " should contain Foo", classNames.get(1).contains("Foo"));
120124
assertTrue(classNames.get(2) + " should contain Foo", classNames.get(2).contains("Foo"));
121-
assertTrue(classNames.get(3) + " should contain Foo", classNames.get(3).contains("Foo"));
122125
} else if (classNames.size() == 5) {
123-
// javac22:
126+
// javac 22 with --release=11:
124127
// JavacWeirdnessTester$1
125128
// JavacWeirdnessTester$2
126129
// JavacWeirdnessTester$1Foo
127130
// JavacWeirdnessTester$2Foo
128131
// JavacWeirdnessTester$3Foo
129132
assertFalse(classNames.get(0) + " should not contain Foo",
130-
classNames.get(0).contains("Foo"));
133+
classNames.get(0).contains("Foo"));
131134
assertFalse(classNames.get(1) + " should not contain Foo",
132-
classNames.get(1).contains("Foo"));
135+
classNames.get(1).contains("Foo"));
133136
assertTrue(classNames.get(2) + " should contain Foo", classNames.get(2).contains("Foo"));
134137
assertTrue(classNames.get(3) + " should contain Foo", classNames.get(2).contains("Foo"));
135138
assertTrue(classNames.get(4) + " should contain Foo", classNames.get(3).contains("Foo"));
136139
} else {
137-
fail("Expected 4 or 5 classes, found " + classNames);
140+
fail("Expected 3 classes, found " + classNames);
138141
}
139142
}
140143

doc/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
sourcepath="${gwt.root}/user/super/com/google/gwt/emul:${gwt.root}/dev/core/super/com/google/gwt/dev/jjs/intrinsic"
145145
encoding="UTF-8"
146146
access="public"
147-
source="${javac.release}"
147+
source="8"
148148
packagenames="${JAVA_PKGS}"
149149
docletpath="${project.build}/../build_tools/doctool/bin"
150150
doclet="com.google.doctool.custom.JavaEmulSummaryDoclet">

0 commit comments

Comments
 (0)