diff --git a/make/test/BuildTestLib.gmk b/make/test/BuildTestLib.gmk index 3dc00aeff87..54b4b306cb8 100644 --- a/make/test/BuildTestLib.gmk +++ b/make/test/BuildTestLib.gmk @@ -52,10 +52,14 @@ $(eval $(call SetupJavaCompilation, BUILD_WB_JAR, \ TARGETS += $(BUILD_WB_JAR) +ifeq ($(call isTargetOs, linux), false) + BUILD_TEST_LIB_JAR_EXCLUDES := jdk/test/lib/containers +endif + $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \ TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ SRC := $(TEST_LIB_SOURCE_DIR), \ - EXCLUDES := jdk/test/lib/containers jdk/test/lib/security, \ + EXCLUDES := $(BUILD_TEST_LIB_JAR_EXCLUDES), \ BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \ HEADERS := $(TEST_LIB_SUPPORT)/test-lib_headers, \ JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \ @@ -64,6 +68,10 @@ $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \ --add-exports java.base/jdk.internal.classfile.attribute=ALL-UNNAMED \ --add-exports java.base/jdk.internal.classfile.constantpool=ALL-UNNAMED \ --add-exports java.base/jdk.internal.module=ALL-UNNAMED \ + --add-exports java.base/jdk.internal.platform=ALL-UNNAMED \ + --add-exports java.base/sun.security.pkcs=ALL-UNNAMED \ + --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED \ + --add-exports java.base/sun.security.x509=ALL-UNNAMED \ --enable-preview, \ )) diff --git a/test/lib/jdk/test/lib/security/CertUtils.java b/test/lib/jdk/test/lib/security/CertUtils.java index c52d98c2572..e5bd3169c0b 100644 --- a/test/lib/jdk/test/lib/security/CertUtils.java +++ b/test/lib/jdk/test/lib/security/CertUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,7 @@ * questions. */ -/** +/* * * @author Sean Mullan * @author Steve Hanna @@ -645,7 +645,9 @@ public class CertUtils { * This class is useful for overriding one or more methods of an * X509Certificate for testing purposes. */ + @SuppressWarnings("deprecation") public static class ForwardingX509Certificate extends X509Certificate { + private static final long serialVersionUID = -8453912214640985478L; private final X509Certificate cert; public ForwardingX509Certificate(X509Certificate cert) { this.cert = cert; diff --git a/test/lib/jdk/test/lib/security/FixedSecureRandom.java b/test/lib/jdk/test/lib/security/FixedSecureRandom.java index cfe8ccc212f..d6a08730b0e 100644 --- a/test/lib/jdk/test/lib/security/FixedSecureRandom.java +++ b/test/lib/jdk/test/lib/security/FixedSecureRandom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,6 +37,8 @@ import java.security.SecureRandom; /// bytes are exhausted. public class FixedSecureRandom extends SecureRandom { + private static final long serialVersionUID = -8753752741562231543L; + private byte[] buffer; private int offset; diff --git a/test/lib/jdk/test/lib/security/SeededSecureRandom.java b/test/lib/jdk/test/lib/security/SeededSecureRandom.java index 305a91c41d2..d56af1aee14 100644 --- a/test/lib/jdk/test/lib/security/SeededSecureRandom.java +++ b/test/lib/jdk/test/lib/security/SeededSecureRandom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,8 @@ import java.util.Random; */ public class SeededSecureRandom extends SecureRandom { + private static final long serialVersionUID = 4657031557630518194L; + private final Random rnd; public static long seed() { diff --git a/test/lib/jdk/test/lib/security/XMLUtils.java b/test/lib/jdk/test/lib/security/XMLUtils.java index efc8f6d5449..e70a30d9b3d 100644 --- a/test/lib/jdk/test/lib/security/XMLUtils.java +++ b/test/lib/jdk/test/lib/security/XMLUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -559,6 +559,7 @@ public class XMLUtils { /** * Adds a new rule to "jdk.xml.dsig.secureValidationPolicy" */ + @SuppressWarnings("dangling-doc-comments") public static void addPolicy(String rule) { String value = Security.getProperty("jdk.xml.dsig.secureValidationPolicy"); value = rule + "," + value;