Skip to content

Commit efdc8be

Browse files
authored
Merge pull request #1862 from SAP/pr-jdk-21.0.6+3
Merge to tag jdk-21.0.6+3
2 parents 27c9bdc + 9bdf2a6 commit efdc8be

File tree

274 files changed

+1455
-938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+1455
-938
lines changed

doc/testing.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ <h1 class="title">Testing the JDK</h1>
7272
<li><a href="#non-us-locale" id="toc-non-us-locale">Non-US
7373
locale</a></li>
7474
<li><a href="#pkcs11-tests" id="toc-pkcs11-tests">PKCS11 Tests</a></li>
75+
<li><a href="#testing-with-alternative-security-providers"
76+
id="toc-testing-with-alternative-security-providers">Testing with
77+
alternative security providers</a></li>
7578
<li><a href="#client-ui-tests" id="toc-client-ui-tests">Client UI
7679
Tests</a></li>
7780
</ul></li>
@@ -589,6 +592,18 @@ <h3 id="pkcs11-tests">PKCS11 Tests</h3>
589592
JTREG=&quot;JAVA_OPTIONS=-Djdk.test.lib.artifacts.nsslib-linux_aarch64=/path/to/NSS-libs&quot;</code></pre>
590593
<p>For more notes about the PKCS11 tests, please refer to
591594
test/jdk/sun/security/pkcs11/README.</p>
595+
<h3 id="testing-with-alternative-security-providers">Testing with
596+
alternative security providers</h3>
597+
<p>Some security tests use a hardcoded provider for
598+
<code>KeyFactory</code>, <code>Cipher</code>,
599+
<code>KeyPairGenerator</code>, <code>KeyGenerator</code>,
600+
<code>AlgorithmParameterGenerator</code>, <code>KeyAgreement</code>,
601+
<code>Mac</code>, <code>MessageDigest</code>, <code>SecureRandom</code>,
602+
<code>Signature</code>, <code>AlgorithmParameters</code>,
603+
<code>Configuration</code>, <code>Policy</code>, or
604+
<code>SecretKeyFactory</code> objects. Specify the
605+
<code>-Dtest.provider.name=NAME</code> property to use a different
606+
provider for the service(s).</p>
592607
<h3 id="client-ui-tests">Client UI Tests</h3>
593608
<h4 id="system-key-shortcuts">System key shortcuts</h4>
594609
<p>Some Client UI tests use key sequences which may be reserved by the

doc/testing.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,15 @@ $ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
615615
For more notes about the PKCS11 tests, please refer to
616616
test/jdk/sun/security/pkcs11/README.
617617

618+
### Testing with alternative security providers
619+
620+
Some security tests use a hardcoded provider for `KeyFactory`, `Cipher`,
621+
`KeyPairGenerator`, `KeyGenerator`, `AlgorithmParameterGenerator`,
622+
`KeyAgreement`, `Mac`, `MessageDigest`, `SecureRandom`, `Signature`,
623+
`AlgorithmParameters`, `Configuration`, `Policy`, or `SecretKeyFactory` objects.
624+
Specify the `-Dtest.provider.name=NAME` property to use a different provider for
625+
the service(s).
626+
618627
### Client UI Tests
619628

620629
#### System key shortcuts

src/java.base/share/classes/java/lang/reflect/Executable.java

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -334,22 +334,34 @@ Type[] getAllGenericParameterTypes() {
334334
// If we have real parameter data, then we use the
335335
// synthetic and mandate flags to our advantage.
336336
if (realParamData) {
337-
final Type[] out = new Type[nonGenericParamTypes.length];
338-
final Parameter[] params = getParameters();
339-
int fromidx = 0;
340-
for (int i = 0; i < out.length; i++) {
341-
final Parameter param = params[i];
342-
if (param.isSynthetic() || param.isImplicit()) {
343-
// If we hit a synthetic or mandated parameter,
344-
// use the non generic parameter info.
345-
out[i] = nonGenericParamTypes[i];
337+
if (getDeclaringClass().isRecord() && this instanceof Constructor) {
338+
/* we could be seeing a compact constructor of a record class
339+
* its parameters are mandated but we should be able to retrieve
340+
* its generic information if present
341+
*/
342+
if (genericParamTypes.length == nonGenericParamTypes.length) {
343+
return genericParamTypes;
346344
} else {
347-
// Otherwise, use the generic parameter info.
348-
out[i] = genericParamTypes[fromidx];
349-
fromidx++;
345+
return nonGenericParamTypes.clone();
350346
}
347+
} else {
348+
final Type[] out = new Type[nonGenericParamTypes.length];
349+
final Parameter[] params = getParameters();
350+
int fromidx = 0;
351+
for (int i = 0; i < out.length; i++) {
352+
final Parameter param = params[i];
353+
if (param.isSynthetic() || param.isImplicit()) {
354+
// If we hit a synthetic or mandated parameter,
355+
// use the non generic parameter info.
356+
out[i] = nonGenericParamTypes[i];
357+
} else {
358+
// Otherwise, use the generic parameter info.
359+
out[i] = genericParamTypes[fromidx];
360+
fromidx++;
361+
}
362+
}
363+
return out;
351364
}
352-
return out;
353365
} else {
354366
// Otherwise, use the non-generic parameter data.
355367
// Without method parameter reflection data, we have

test/hotspot/jtreg/compiler/c1/TestTraceLinearScanLevel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
* @bug 8251093
2727
* @summary Sanity check the flag TraceLinearScanLevel with the highest level in a silent HelloWorld program.
2828
*
29-
* @requires vm.debug == true & vm.compiler1.enabled
30-
* @run main/othervm -XX:TraceLinearScanLevel=4 compiler.c1.TestTraceLinearScanLevel
29+
* @requires vm.debug == true & vm.compiler1.enabled & vm.compMode != "Xcomp"
30+
* @run main/othervm -Xbatch -XX:TraceLinearScanLevel=4 compiler.c1.TestTraceLinearScanLevel
3131
*/
3232
package compiler.c1;
3333

test/hotspot/jtreg/runtime/cds/appcds/ProhibitedPackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception {
5454
// will be ignored during dumping.
5555
TestCommon.dump(appJar, classlist, "-Xlog:cds")
5656
.shouldContain("Dumping")
57-
.shouldContain("[cds] Prohibited package for non-bootstrap classes: java/lang/Prohibited.class")
57+
.shouldContain("Prohibited package for non-bootstrap classes: java/lang/Prohibited.class")
5858
.shouldHaveExitValue(0);
5959
}
6060

test/hotspot/jtreg/vmTestbase/nsk/jdb/kill/kill001/kill001a.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -141,6 +141,16 @@ public MyThread(String n, Throwable e) {
141141
expectedException = e;
142142
}
143143

144+
145+
static public int[] trash;
146+
147+
void methodForException() {
148+
trash = new int[10];
149+
for (int i = 0; ;i++) {
150+
trash[i % trash.length] = i;
151+
}
152+
}
153+
144154
public void run() {
145155
// Concatenate strings in advance to avoid lambda calculations later
146156
String ThreadFinished = "Thread finished: " + this.name;
@@ -156,8 +166,9 @@ public void run() {
156166
try {
157167
synchronized (kill001a.lock) { }
158168
// We need some code that does an invoke here to make sure the async exception
159-
// gets thrown before we leave the try block. Printing a log message works well.
160-
kill001a.log.display("exited synchronized");
169+
// gets thrown before we leave the try block.
170+
// The methodForException should work until exception is thrown.
171+
methodForException();
161172
} catch (Throwable t) {
162173
if (t == expectedException) {
163174
kill001a.log.display(CaughtExpected);

test/hotspot/jtreg/vmTestbase/nsk/jdi/ListeningConnector/stopListening/stoplis001.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ private int runIt(String argv[], PrintStream out) {
8383
this.out = out;
8484
log = new Log(out, argHandler);
8585

86-
Map<String,? extends com.sun.jdi.connect.Connector.Argument> cArgs1 = initConnector(argHandler.getTransportPort());
8786
Map<String,? extends com.sun.jdi.connect.Connector.Argument> cArgs2 = initConnector(null);
8887
if ((addr = startListen(cArgs2)) == null) {
8988
log.complain("FAILURE: unable to start listening the address " +
@@ -93,6 +92,12 @@ private int runIt(String argv[], PrintStream out) {
9392
else
9493
log.display("TEST: start listening the address " + addr);
9594

95+
// argHandler.getTransportPort() returns a free port (different from the port allocated by startListen(cArgs2))
96+
Map<String,? extends com.sun.jdi.connect.Connector.Argument> cArgs1 = initConnector(argHandler.getTransportPort());
97+
98+
log.display("cArgs1: " + cArgs1);
99+
log.display("cArgs2: " + cArgs2);
100+
96101
/* Check that an Exception is thrown if ListeningConnector.stopListening
97102
has been invoked with argument map different from the one given for
98103
a previous ListeningConnector.startListening() invocation */

test/hotspot/jtreg/vmTestbase/nsk/jdi/ListeningConnector/stopListening/stoplis001/TEST.properties

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/hotspot/jtreg/vmTestbase/nsk/jdi/ListeningConnector/stopListening/stoplis001/TestDescription.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
* argument map is the same with the one given for the previous
4141
* ListeningConnector.startListening() invocation.
4242
*
43-
* NOTE: this test is tagged "nonconcurrent" because it uses the default
44-
* "javadebug" shmem file, as do some other tests.
45-
*
4643
* @library /vmTestbase
4744
* /test/lib
4845
* @build nsk.jdi.ListeningConnector.stopListening.stoplis001

test/hotspot/jtreg/vmTestbase/nsk/jdi/PlugConnectors/AttachConnector/plugAttachConnect001/plugAttachConnect001.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -147,7 +147,6 @@ private int runThis (String argv[], PrintStream out) {
147147

148148
argsHandler = new ArgumentHandler(argv);
149149
logHandler = new Log(out, argsHandler);
150-
logHandler.enableErrorsSummary(false);
151150

152151
String expectedPlugAttachConnectorName = "PlugAttachConnector001_Name";
153152
String expectedPlugAttachConnectorDescription = "PlugAttachConnector001_Description";

0 commit comments

Comments
 (0)