Skip to content

Commit b95b2d4

Browse files
committed
Update bundled JDK to 25 (elastic#134910)
Co-authored-by: Mark Vieira <[email protected]> (cherry picked from commit 4aa0f16) # Conflicts: # x-pack/plugin/esql/build.gradle # x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/custom/CustomRequestManagerTests.java # x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/custom/request/CustomRequestTests.java
1 parent 3dc5aa0 commit b95b2d4

File tree

10 files changed

+30
-12
lines changed

10 files changed

+30
-12
lines changed

build-tools-internal/src/main/resources/fips_java.security

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ jdk.xml.dsig.secureValidationPolicy=\
4949
noRetrievalMethodLoops
5050
jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\
5151
java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!*
52+
53+
# Needed since JDK25 to match the default config in the out-of-the-box java.security
54+
jdk.includeInExceptions=hostInfoExclSocket

build-tools-internal/src/main/resources/fips_java_oracle.security

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ jdk.xml.dsig.secureValidationPolicy=\
5050
noRetrievalMethodLoops
5151
jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\
5252
java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!*
53+
54+
# Needed since JDK25 to match the default config in the out-of-the-box java.security
55+
jdk.includeInExceptions=hostInfoExclSocket

build-tools-internal/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ elasticsearch = 8.18.8
22
lucene = 9.12.1
33

44
bundled_jdk_vendor = openjdk
5-
bundled_jdk = 24.0.2+12@fdc5d0102fe0414db21410ad5834341f
5+
bundled_jdk = 25+36@bd75d5f9689641da8e1daabeccb5528b
66
# optional dependencies
77
spatial4j = 0.7
88
jts = 1.15.0

client/rest/src/test/java/org/elasticsearch/client/RestClientMultipleHostsIntegTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import static org.elasticsearch.client.RestClientTestUtil.randomErrorNoRetryStatusCode;
5050
import static org.elasticsearch.client.RestClientTestUtil.randomOkStatusCode;
5151
import static org.hamcrest.CoreMatchers.instanceOf;
52+
import static org.hamcrest.Matchers.startsWith;
5253
import static org.junit.Assert.assertEquals;
5354
import static org.junit.Assert.assertThat;
5455
import static org.junit.Assert.assertTrue;
@@ -314,7 +315,7 @@ public void testNodeSelector() throws Exception {
314315
} catch (ConnectException e) {
315316
// Windows isn't consistent here. Sometimes the message is even null!
316317
if (false == System.getProperty("os.name").startsWith("Windows")) {
317-
assertEquals("Connection refused", e.getMessage());
318+
assertThat(e.getMessage(), startsWith("Connection refused"));
318319
}
319320
}
320321
} else {

client/rest/src/test/java/org/elasticsearch/client/RestClientTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
import static java.util.Collections.singletonList;
4646
import static org.hamcrest.Matchers.instanceOf;
47+
import static org.hamcrest.Matchers.startsWith;
4748
import static org.junit.Assert.assertEquals;
4849
import static org.junit.Assert.assertFalse;
4950
import static org.junit.Assert.assertSame;
@@ -105,7 +106,7 @@ public void onSuccess(Response response) {
105106
public void onFailure(Exception exception) {
106107
try {
107108
assertThat(exception, instanceOf(IllegalArgumentException.class));
108-
assertEquals("Expected scheme name at index 0: ::http:///", exception.getMessage());
109+
assertThat(exception.getMessage(), startsWith(("Expected scheme name")));
109110
} finally {
110111
latch.countDown();
111112
}

test/test-clusters/src/main/resources/fips/fips_java.security

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ jdk.xml.dsig.secureValidationPolicy=\
4949
noRetrievalMethodLoops
5050
jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\
5151
java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!*
52+
53+
# Needed since JDK25 to match the default config in the out-of-the-box java.security
54+
jdk.includeInExceptions=hostInfoExclSocket

test/test-clusters/src/main/resources/fips/fips_java_oracle.security

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,7 @@ jdk.xml.dsig.secureValidationPolicy=\
5050
noRetrievalMethodLoops
5151
jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\
5252
java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!*
53+
54+
# Needed since JDK25 to match the default config in the out-of-the-box java.security
55+
jdk.includeInExceptions=hostInfoExclSocket
56+

x-pack/plugin/esql/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ interface Injected {
7878
}
7979

8080
tasks.named("test").configure {
81+
// prevent empty stacktraces on JDK 25 for intrinsic Math.*Exact invocations
82+
// https://bugs.openjdk.org/browse/JDK-8367990
83+
// https://github.com/elastic/elasticsearch/issues/135009
84+
jvmArgs '-XX:-OmitStackTraceInFastThrow'
85+
8186
if (buildParams.ci == false) {
8287
systemProperty 'generateDocs', true
8388
def injected = project.objects.newInstance(Injected)

x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfigurationTests.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.elasticsearch.test.ESTestCase;
1212
import org.elasticsearch.xpack.sql.client.SslConfig;
1313
import org.elasticsearch.xpack.sql.client.SuppressForbidden;
14+
import org.hamcrest.Matchers;
1415

1516
import java.net.URI;
1617
import java.net.URISyntaxException;
@@ -43,12 +44,7 @@ private JdbcConfiguration ci(String url) throws SQLException {
4344

4445
public void testInvalidUrl() {
4546
JdbcSQLException e = expectThrows(JdbcSQLException.class, () -> ci("jdbc:es://localhost9200/?ssl=#5#"));
46-
assertEquals(
47-
"Invalid URL: Invalid connection configuration: Illegal character in fragment at index 28: "
48-
+ "http://localhost9200/?ssl=#5#; format should be "
49-
+ "[jdbc:[es|elasticsearch]://[[http|https]://]?[host[:port]]?/[prefix]?[\\?[option=value]&]*]",
50-
e.getMessage()
51-
);
47+
assertThat(e.getMessage(), Matchers.startsWith("Invalid URL: Invalid connection configuration: Illegal character in fragment"));
5248
}
5349

5450
public void testJustThePrefix() throws Exception {

x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/UriUtilsTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import static org.elasticsearch.xpack.sql.client.UriUtils.appendSegmentToPath;
1717
import static org.elasticsearch.xpack.sql.client.UriUtils.parseURI;
1818
import static org.elasticsearch.xpack.sql.client.UriUtils.removeQuery;
19+
import static org.hamcrest.Matchers.matchesPattern;
1920

2021
public class UriUtilsTests extends ESTestCase {
2122

@@ -89,9 +90,10 @@ public void testUnsupportedProtocol() throws Exception {
8990
}
9091

9192
public void testMalformedWhiteSpace() throws Exception {
92-
assertEquals(
93-
"Invalid connection configuration: Illegal character in authority at index 7: http:// ",
94-
expectThrows(IllegalArgumentException.class, () -> parseURI(" ", DEFAULT_URI)).getMessage()
93+
assertThat(
94+
expectThrows(IllegalArgumentException.class, () -> parseURI(" ", DEFAULT_URI)).getMessage(),
95+
// Use a lenient regex here since later JDKs trim exception message whitespace
96+
matchesPattern("^Invalid connection configuration: Illegal character in authority at index 7: http:// ?")
9597
);
9698
}
9799

0 commit comments

Comments
 (0)