Skip to content

Commit 807d883

Browse files
ludochgae-java-bot
authored andcommitted
Default java17 runtime to Jetty 12.0 (EE8).
PiperOrigin-RevId: 899703665 Change-Id: I3ba603e833cbdfbff24d79e1231f833c6c28ba14
1 parent 1a0c0aa commit 807d883

2 files changed

Lines changed: 11 additions & 38 deletions

File tree

appengine_init/src/main/java/com/google/appengine/init/AppEngineWebXmlInitialParse.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public final class AppEngineWebXmlInitialParse {
8888
* appengine.use.EE11} are set to true, defaults are applied as follows:
8989
*
9090
* <ul>
91-
* <li>{@code runtime="java17"}: Defaults to Jetty 9.4 based environment (EE6 / Servlet 3.1).
91+
* <li>{@code runtime="java17"}: Defaults to Jetty 12.0 based environment (EE8).
9292
* <li>{@code runtime="java21"}: Defaults to Jetty 12.0 / EE10, unless {@code
9393
* appengine.use.jetty121=true}, in which case it defaults to Jetty 12.1 / EE11.
9494
* <li>{@code runtime="java25"}: Defaults to Jetty 12.1 / EE11.
@@ -99,9 +99,7 @@ public final class AppEngineWebXmlInitialParse {
9999
* <ul>
100100
* <li>{@code <runtime>java17</runtime>}:
101101
* <ul>
102-
* <li>No flags set: Jetty 9.4 (EE6) unless env variable
103-
* EXPERIMENT_ENABLE_JETTY12_FOR_JAVA is set to true, in which case Jetty 12.0 (EE8)
104-
* is used.
102+
* <li>No flags set: Jetty 12.0 (EE8)
105103
* <li>{@code appengine.use.EE8=true}: Jetty 12.0 (EE8)
106104
* <li>{@code appengine.use.EE10=true}: Jetty 12.0 (EE10)
107105
* <li>{@code appengine.use.EE10=true} and {@code appengine.use.jetty121=true}: Jetty 12.1
@@ -213,10 +211,7 @@ public void handleRuntimeProperties() {
213211
if (trueCount == 0) {
214212
// Apply defaults based on javaVersion
215213
if (Objects.equals(runtimeId, "java17")) {
216-
System.setProperty(
217-
"appengine.use.EE8",
218-
String.valueOf(
219-
Objects.equals(envProvider.apply("EXPERIMENT_ENABLE_JETTY12_FOR_JAVA"), "true")));
214+
System.setProperty("appengine.use.EE8", "true");
220215
} else if (Objects.equals(runtimeId, "java21")) {
221216
if (Boolean.parseBoolean(System.getProperty("appengine.use.jetty121", "false"))) {
222217
System.setProperty("appengine.use.EE11", "true");
@@ -245,9 +240,7 @@ public void handleRuntimeProperties() {
245240
// Log the runtime configuration so we can see it in the app logs.
246241
StringBuilder configLog =
247242
new StringBuilder("AppEngine runtime configuration: runtimeId=").append(runtimeId);
248-
if (Objects.equals(envProvider.apply("EXPERIMENT_ENABLE_JETTY12_FOR_JAVA"), "true")) {
249-
configLog.append(", with Jetty 12");
250-
}
243+
configLog.append(", with Jetty 12");
251244
if (Objects.equals(envProvider.apply("EXPERIMENT_ENABLE_HTTP_CONNECTOR_FOR_JAVA"), "true")) {
252245
configLog.append(", with HTTP Connector");
253246
}

appengine_init/src/test/java/com/google/appengine/init/AppEngineWebXmlInitialParseTest.java

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,9 @@ public void testJava17() throws IOException {
9999
</appengine-web-app>
100100
""");
101101
new AppEngineWebXmlInitialParse(tempFile.toFile().getAbsolutePath()).handleRuntimeProperties();
102-
assertFalse(Boolean.getBoolean("appengine.use.EE8")); // Default to jetty 9.4 which is EE6
102+
assertTrue(Boolean.getBoolean("appengine.use.EE8")); // Default to jetty 12.0 which is EE8
103103
assertFalse(Boolean.getBoolean("appengine.use.EE10"));
104104
assertFalse(Boolean.getBoolean("appengine.use.EE11"));
105-
assertFalse(Boolean.getBoolean("appengine.use.EE8"));
106105
assertFalse(Boolean.getBoolean("appengine.use.jetty121"));
107106
}
108107

@@ -118,7 +117,7 @@ public void testJava17WithJetty121() throws IOException {
118117
</appengine-web-app>
119118
""");
120119
new AppEngineWebXmlInitialParse(tempFile.toFile().getAbsolutePath()).handleRuntimeProperties();
121-
assertFalse(Boolean.getBoolean("appengine.use.EE8"));
120+
assertTrue(Boolean.getBoolean("appengine.use.EE8")); // Default to jetty 12.0 which is EE8
122121
assertFalse(Boolean.getBoolean("appengine.use.EE10"));
123122
assertFalse(Boolean.getBoolean("appengine.use.EE11"));
124123
assertTrue(Boolean.getBoolean("appengine.use.jetty121"));
@@ -409,7 +408,7 @@ public void testJava21WithEE11() throws IOException {
409408
}
410409

411410
@Test
412-
public void testJava17WithExperimentEnableJetty12() throws IOException {
411+
public void testJava17WithJetty12() throws IOException {
413412
createTempAppEngineWebXml(
414413
"""
415414
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
@@ -418,13 +417,7 @@ public void testJava17WithExperimentEnableJetty12() throws IOException {
418417
""");
419418
AppEngineWebXmlInitialParse parser =
420419
new AppEngineWebXmlInitialParse(tempFile.toFile().getAbsolutePath());
421-
parser.setEnvProvider(
422-
key -> {
423-
if (Objects.equals(key, "EXPERIMENT_ENABLE_JETTY12_FOR_JAVA")) {
424-
return "true";
425-
}
426-
return null;
427-
});
420+
428421
parser.handleRuntimeProperties();
429422
assertTrue(Boolean.getBoolean("appengine.use.EE8"));
430423
assertFalse(Boolean.getBoolean("appengine.use.EE10"));
@@ -444,13 +437,6 @@ public void testJava17WithWhitespace() throws IOException {
444437
""");
445438
AppEngineWebXmlInitialParse parser =
446439
new AppEngineWebXmlInitialParse(tempFile.toFile().getAbsolutePath());
447-
parser.setEnvProvider(
448-
key -> {
449-
if (Objects.equals(key, "EXPERIMENT_ENABLE_JETTY12_FOR_JAVA")) {
450-
return "true";
451-
}
452-
return null;
453-
});
454440
parser.handleRuntimeProperties();
455441
assertTrue(Boolean.getBoolean("appengine.use.EE8"));
456442
}
@@ -712,7 +698,7 @@ public void testLogAllFlagsFalse() throws IOException {
712698
createTempAppEngineWebXml(
713699
"""
714700
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
715-
<runtime>java17</runtime>
701+
<runtime>java11</runtime>
716702
</appengine-web-app>
717703
""");
718704
new AppEngineWebXmlInitialParse(tempFile.toFile().getAbsolutePath()).handleRuntimeProperties();
@@ -756,7 +742,7 @@ public void testLogNotAllFlagsFalseWhenFlagIsSet() throws IOException {
756742
}
757743

758744
@Test
759-
public void testLogExperimentJetty12() throws IOException {
745+
public void testLogJetty12() throws IOException {
760746
Logger logger = Logger.getLogger(AppEngineWebXmlInitialParse.class.getName());
761747
TestHandler handler = new TestHandler();
762748
logger.addHandler(handler);
@@ -769,13 +755,7 @@ public void testLogExperimentJetty12() throws IOException {
769755
""");
770756
AppEngineWebXmlInitialParse parser =
771757
new AppEngineWebXmlInitialParse(tempFile.toFile().getAbsolutePath());
772-
parser.setEnvProvider(
773-
key -> {
774-
if (Objects.equals(key, "EXPERIMENT_ENABLE_JETTY12_FOR_JAVA")) {
775-
return "true";
776-
}
777-
return null;
778-
});
758+
779759
parser.handleRuntimeProperties();
780760
boolean found = false;
781761
for (LogRecord record : handler.records) {

0 commit comments

Comments
 (0)