Skip to content

Commit 2282930

Browse files
authored
Merge pull request #1967 from SAP/pr-jdk-17.0.16+3
Merge to tag jdk-17.0.16+3
2 parents 3b24a0f + c340fa3 commit 2282930

File tree

384 files changed

+5280
-30788
lines changed

Some content is hidden

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

384 files changed

+5280
-30788
lines changed

make/data/cacerts/camerfirmachamberscommerceca

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

make/data/cacerts/camerfirmachambersignca

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

make/hotspot/lib/CompileGtest.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
4949
$(GTEST_FRAMEWORK_SRC)/googletest/src \
5050
$(GTEST_FRAMEWORK_SRC)/googlemock/src, \
5151
INCLUDE_FILES := gtest-all.cc gmock-all.cc, \
52-
DISABLED_WARNINGS_gcc := undef unused-result format-nonliteral maybe-uninitialized, \
52+
DISABLED_WARNINGS_gcc := undef unused-result format-nonliteral \
53+
maybe-uninitialized zero-as-null-pointer-constant, \
5354
DISABLED_WARNINGS_clang := undef unused-result format-nonliteral, \
5455
CFLAGS := $(JVM_CFLAGS) \
5556
-I$(GTEST_FRAMEWORK_SRC)/googletest \

src/java.base/share/classes/java/text/DateFormatSymbols.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ public void setZoneStrings(String[][] newZoneStrings) {
605605
for (int i = 0; i < newZoneStrings.length; ++i) {
606606
int len = newZoneStrings[i].length;
607607
if (len < 5) {
608-
throw new IllegalArgumentException();
608+
throw new IllegalArgumentException(String.format(
609+
"Row %s of the input array does not have a length of at least 5", i));
609610
}
610611
aCopy[i] = Arrays.copyOf(newZoneStrings[i], len);
611612
}

src/java.base/share/classes/sun/security/validator/CamerfirmaTLSPolicy.java

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,14 @@ final class CamerfirmaTLSPolicy {
4343

4444
private static final Debug debug = Debug.getInstance("certpath");
4545

46-
// SHA-256 certificate fingerprints of distrusted roots
47-
private static final Set<String> FINGERPRINTS = Set.of(
48-
// cacerts alias: camerfirmachamberscommerceca
49-
// DN: CN=Chambers of Commerce Root,
50-
// OU=http://www.chambersign.org,
51-
// O=AC Camerfirma SA CIF A82743287, C=EU
52-
"0C258A12A5674AEF25F28BA7DCFAECEEA348E541E6F5CC4EE63B71B361606AC3",
53-
// cacerts alias: camerfirmachambersca
54-
// DN: CN=Chambers of Commerce Root - 2008,
55-
// O=AC Camerfirma S.A., SERIALNUMBER=A82743287,
56-
// L=Madrid (see current address at www.camerfirma.com/address),
57-
// C=EU
58-
"063E4AFAC491DFD332F3089B8542E94617D893D7FE944E10A7937EE29D9693C0",
59-
// cacerts alias: camerfirmachambersignca
60-
// DN: CN=Global Chambersign Root - 2008,
61-
// O=AC Camerfirma S.A., SERIALNUMBER=A82743287,
62-
// L=Madrid (see current address at www.camerfirma.com/address),
63-
// C=EU
64-
"136335439334A7698016A0D324DE72284E079D7B5220BB8FBD747816EEBEBACA"
65-
);
46+
// SHA-256 certificate fingerprint of distrusted root for TLS
47+
// cacerts alias: camerfirmachambersca
48+
// DN: CN=Chambers of Commerce Root - 2008,
49+
// O=AC Camerfirma S.A., SERIALNUMBER=A82743287,
50+
// L=Madrid (see current address at www.camerfirma.com/address),
51+
// C=EU
52+
private static final String FINGERPRINT =
53+
"063E4AFAC491DFD332F3089B8542E94617D893D7FE944E10A7937EE29D9693C0";
6654

6755
// Any TLS Server certificate that is anchored by one of the Camerfirma
6856
// roots above and is issued after this date will be distrusted.
@@ -85,7 +73,7 @@ static void checkDistrust(X509Certificate[] chain)
8573
throw new ValidatorException("Cannot generate fingerprint for "
8674
+ "trust anchor of TLS server certificate");
8775
}
88-
if (FINGERPRINTS.contains(fp)) {
76+
if (FINGERPRINT.equalsIgnoreCase(fp)) {
8977
Date notBefore = chain[0].getNotBefore();
9078
LocalDate ldNotBefore = LocalDate.ofInstant(notBefore.toInstant(),
9179
ZoneOffset.UTC);

src/java.desktop/share/classes/javax/swing/SwingUtilities.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,6 +2073,10 @@ static int findDisplayedMnemonicIndex(String text, int mnemonic) {
20732073
return -1;
20742074
}
20752075

2076+
if (mnemonic >= 'a' && mnemonic <= 'z') {
2077+
return -1;
2078+
}
2079+
20762080
char uc = Character.toUpperCase((char)mnemonic);
20772081
char lc = Character.toLowerCase((char)mnemonic);
20782082

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,9 @@ public void addAnnotation(Address addr, OopHandle handle) {
10871087
G1CollectedHeap heap = (G1CollectedHeap)collHeap;
10881088
HeapRegion region = heap.hrm().getByAddress(handle);
10891089

1090-
if (region.isFree()) {
1090+
if (region == null) {
1091+
// intentionally skip
1092+
} else if (region.isFree()) {
10911093
anno = "Free ";
10921094
bad = false;
10931095
} else if (region.isYoung()) {

test/hotspot/gtest/gtestMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static void run_in_new_thread(const args_t* args) {
334334
extern "C" void* thread_wrapper(void* p) {
335335
const args_t* const p_args = (const args_t*) p;
336336
runUnitTestsInner(p_args->argc, p_args->argv);
337-
return 0;
337+
return nullptr;
338338
}
339339

340340
static void run_in_new_thread(const args_t* args) {

test/hotspot/jtreg/applications/jcstress/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
1+
Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
22
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33

44
This code is free software; you can redistribute it and/or modify it
@@ -37,5 +37,5 @@ The */Test.java files should never be modified directly, because they are
3737
generated by TestGenerator and therefore all required changes must be made in
3838
that class.
3939

40-
[1] https://wiki.openjdk.java.net/display/CodeTools/jcstress
40+
[1] https://wiki.openjdk.org/display/CodeTools/jcstress
4141

test/hotspot/jtreg/applications/jcstress/TestGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* added to classpath. One can replace @notest by @test in jtreg test
5757
* description above to run this class with jtreg.
5858
*
59-
* @see <a href=https://wiki.openjdk.java.net/display/CodeTools/jcstress>jcstress</a>
59+
* @see <a href=https://wiki.openjdk.org/display/CodeTools/jcstress>jcstress</a>
6060
*/
6161
public class TestGenerator {
6262
private static final String COPYRIGHT;

test/hotspot/jtreg/compiler/c2/Test6880034.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
// an incorrect result on 32-bit server VMs on SPARC due to a regression
5353
// introduced by the change: "6420645: Create a vm that uses compressed oops
5454
// for up to 32gb heapsizes"
55-
// (http://hg.openjdk.java.net/jdk7/jdk7/hotspot/rev/ba764ed4b6f2). Further
55+
// (https://git.openjdk.org/jdk/commit/4a831d4). Further
5656
// investigation showed that change 6420645 is not really the root cause of
5757
// this error but only reveals a problem with the float register encodings in
5858
// sparc.ad which was hidden until now.

test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestDynamicConstant.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2022, 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
@@ -63,8 +63,8 @@
6363
/**
6464
* Tests support for Dynamic constants.
6565
*
66-
* @see "https://openjdk.java.net/jeps/309"
67-
* @see "https://bugs.openjdk.java.net/browse/JDK-8177279"
66+
* @see "https://openjdk.org/jeps/309"
67+
* @see "https://bugs.openjdk.org/browse/JDK-8177279"
6868
*/
6969
public class TestDynamicConstant implements Opcodes {
7070

test/hotspot/jtreg/compiler/lib/ir_framework/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ More information about the internals and the workflow of the framework can be fo
123123
## 4. Internal Framework Tests
124124
There are various tests to verify the correctness of the test framework. These tests can be found in [ir_framework](../../../testlibrary_tests/ir_framework) and can directly be run with JTreg. The tests are part of the normal JTreg tests of HotSpot and should be run upon changing the framework code as a minimal form of testing.
125125

126-
Additional testing was performed by converting all compiler Inline Types tests that used the currently present IR test framework in Valhalla (see [JDK-8263024](https://bugs.openjdk.java.net/browse/JDK-8263024)). It is strongly advised to make sure a change to the framework still lets these converted tests in Valhalla pass as part of an additional testing step.
126+
Additional testing was performed by converting all compiler Inline Types tests that used the currently present IR test framework in Valhalla (see [JDK-8263024](https://bugs.openjdk.org/browse/JDK-8263024)). It is strongly advised to make sure a change to the framework still lets these converted tests in Valhalla pass as part of an additional testing step.
127127

128128
## 5. Framework Package Structure
129129
A user only needs to import classes from the package `compiler.lib.ir_framework` (e.g. `import compiler.lib.ir_framework.*;`) which represents the interface classes to the framework. The remaining framework internal classes are kept in separate subpackages and should not directly be imported:
@@ -134,4 +134,4 @@ A user only needs to import classes from the package `compiler.lib.ir_framework`
134134
- `compiler.lib.ir_framework.shared`: These classes can be called from either the driver, flag, or test VM.
135135

136136
## 6. Summary
137-
The initial design and feature set was kept simple and straight forward and serves well for small to medium sized tests. There are a lot of possibilities to further enhance the framework and make it more powerful. This can be tackled in additional RFEs. A few ideas can be found as subtasks of the [initial RFE](https://bugs.openjdk.java.net/browse/JDK-8254129) for this framework.
137+
The initial design and feature set was kept simple and straight forward and serves well for small to medium sized tests. There are a lot of possibilities to further enhance the framework and make it more powerful. This can be tackled in additional RFEs. A few ideas can be found as subtasks of the [initial RFE](https://bugs.openjdk.org/browse/JDK-8254129) for this framework.

test/hotspot/jtreg/compiler/membars/DekkerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class DekkerTest {
4747
/*
4848
Read After Write Test (basically a simple Dekker test with volatile variables)
4949
Derived from the original jcstress test, available at:
50-
http://hg.openjdk.java.net/code-tools/jcstress/file/6c339a5aa00d/
50+
hhttps://git.openjdk.org/jcstress/commit/15acd86
5151
tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/DekkerTest.java
5252
*/
5353

test/hotspot/jtreg/gc/g1/logging/TestG1LoggingFailure.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2022, 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
@@ -55,7 +55,7 @@ public static void main(String[] args) throws Throwable {
5555

5656
options.add(Alloc.class.getName());
5757

58-
// According to https://bugs.openjdk.java.net/browse/JDK-8146009 failure happens not every time.
58+
// According to https://bugs.openjdk.org/browse/JDK-8146009 failure happens not every time.
5959
// Will try to reproduce this failure.
6060
for (int iteration = 0; iteration < 40; ++iteration) {
6161
startVM(options);

test/hotspot/jtreg/gc/testlibrary/PerfCounter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2022, 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
@@ -28,7 +28,7 @@
2828
/**
2929
* Represents a performance counter in the JVM.
3030
*
31-
* See http://openjdk.java.net/groups/hotspot/docs/Serviceability.html#bjvmstat
31+
* See https://openjdk.org/groups/hotspot/docs/Serviceability.html#bjvmstat
3232
* for more details about performance counters.
3333
*/
3434
public class PerfCounter {

test/hotspot/jtreg/runtime/jni/getCreatedJavaVMs/exeGetCreatedJavaVMs.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,19 @@ void *thread_runner(void *threadid) {
8989

9090
int main (int argc, char* argv[]) {
9191
pthread_t threads[NUM_THREADS];
92+
pthread_attr_t attr;
93+
pthread_attr_init(&attr);
94+
size_t stack_size = 0x100000;
95+
pthread_attr_setstacksize(&attr, stack_size);
9296
for (int i = 0; i < NUM_THREADS; i++ ) {
9397
printf("[*] Creating thread %d\n", i);
94-
int status = pthread_create(&threads[i], NULL, thread_runner, (void *)(intptr_t)i);
98+
int status = pthread_create(&threads[i], &attr, thread_runner, (void *)(intptr_t)i);
9599
if (status != 0) {
96100
printf("[*] Error creating thread %d - %d\n", i, status);
97101
exit(-1);
98102
}
99103
}
104+
pthread_attr_destroy(&attr);
100105
for (int i = 0; i < NUM_THREADS; i++ ) {
101106
pthread_join(threads[i], NULL);
102107
}

test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,18 @@ Java_TestNativeStack_triggerJNIStackTrace
109109

110110
warning = warn;
111111

112-
if ((res = pthread_create(&thread, NULL, thread_start, NULL)) != 0) {
112+
pthread_attr_t attr;
113+
pthread_attr_init(&attr);
114+
size_t stack_size = 0x100000;
115+
pthread_attr_setstacksize(&attr, stack_size);
116+
117+
if ((res = pthread_create(&thread, &attr, thread_start, NULL)) != 0) {
113118
fprintf(stderr, "TEST ERROR: pthread_create failed: %s (%d)\n", strerror(res), res);
114119
exit(1);
115120
}
116121

122+
pthread_attr_destroy(&attr);
123+
117124
if ((res = pthread_join(thread, NULL)) != 0) {
118125
fprintf(stderr, "TEST ERROR: pthread_join failed: %s (%d)\n", strerror(res), res);
119126
exit(1);

0 commit comments

Comments
 (0)