Skip to content

Commit 4b94ae8

Browse files
authored
Merge pull request #2106 from SAP/pr-jdk-21.0.10+3
Merge to tag jdk-21.0.10+3
2 parents 2cb40c9 + 46687d3 commit 4b94ae8

File tree

30 files changed

+1296
-321
lines changed

30 files changed

+1296
-321
lines changed

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3401,7 +3401,7 @@ encode %{
34013401
}
34023402
%}
34033403

3404-
/// mov envcodings
3404+
// mov encodings
34053405

34063406
enc_class aarch64_enc_movw_imm(iRegI dst, immI src) %{
34073407
C2_MacroAssembler _masm(&cbuf);

src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2025, 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
@@ -226,6 +226,16 @@ class RunExecutorWithMsgLoop {
226226
};
227227

228228

229+
void enableConsoleCtrlHandler(bool enable) {
230+
if (!SetConsoleCtrlHandler(NULL, enable ? FALSE : TRUE)) {
231+
JP_THROW(SysError(tstrings::any() << "SetConsoleCtrlHandler(NULL, "
232+
<< (enable ? "FALSE" : "TRUE")
233+
<< ") failed",
234+
SetConsoleCtrlHandler));
235+
}
236+
}
237+
238+
229239
void launchApp() {
230240
// [RT-31061] otherwise UI can be left in back of other windows.
231241
::AllowSetForegroundWindow(ASFW_ANY);
@@ -279,6 +289,19 @@ void launchApp() {
279289
exec.arg(arg);
280290
});
281291

292+
exec.afterProcessCreated([&](HANDLE pid) {
293+
//
294+
// Ignore Ctrl+C in the current process.
295+
// This will prevent child process termination without allowing
296+
// it to handle Ctrl+C events.
297+
//
298+
// Disable the default Ctrl+C handler *after* the child process
299+
// has been created as it is inheritable and we want the child
300+
// process to have the default handler.
301+
//
302+
enableConsoleCtrlHandler(false);
303+
});
304+
282305
DWORD exitCode = RunExecutorWithMsgLoop::apply(exec);
283306

284307
exit(exitCode);

src/jdk.jpackage/windows/native/common/Executor.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, 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
@@ -161,6 +161,10 @@ UniqueHandle Executor::startProcess(UniqueHandle* threadHandle) const {
161161
}
162162
}
163163

164+
if (afterProcessCreatedCallback) {
165+
afterProcessCreatedCallback(processInfo.hProcess);
166+
}
167+
164168
// Return process handle.
165169
return UniqueHandle(processInfo.hProcess);
166170
}

src/jdk.jpackage/windows/native/common/Executor.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, 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
@@ -26,6 +26,8 @@
2626
#ifndef EXECUTOR_H
2727
#define EXECUTOR_H
2828

29+
#include <functional>
30+
2931
#include "tstrings.h"
3032
#include "UniqueHandle.h"
3133

@@ -97,6 +99,14 @@ class Executor {
9799
*/
98100
int execAndWaitForExit() const;
99101

102+
/**
103+
* Call provided function after the process hass been created.
104+
*/
105+
Executor& afterProcessCreated(const std::function<void(HANDLE)>& v) {
106+
afterProcessCreatedCallback = v;
107+
return *this;
108+
}
109+
100110
private:
101111
UniqueHandle startProcess(UniqueHandle* threadHandle=0) const;
102112

@@ -106,6 +116,7 @@ class Executor {
106116
HANDLE jobHandle;
107117
tstring_array argsArray;
108118
std::wstring appPath;
119+
std::function<void(HANDLE)> afterProcessCreatedCallback;
109120
};
110121

111122
#endif // #ifndef EXECUTOR_H

src/jdk.management/windows/native/libmanagement_ext/OperatingSystemImpl.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, 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
@@ -50,6 +50,8 @@
5050
#include <process.h>
5151
#pragma warning(pop)
5252

53+
#include <sysinfoapi.h>
54+
5355
typedef unsigned __int32 juint;
5456
typedef unsigned __int64 julong;
5557

@@ -215,10 +217,10 @@ static PdhLookupPerfNameByIndexFunc PdhLookupPerfNameByIndex_i;
215217
*/
216218
typedef struct {
217219
HQUERY query;
218-
uint64_t lastUpdate; // Last time query was updated (ticks)
220+
uint64_t lastUpdate; // Last time query was updated (millis)
219221
} UpdateQueryS, *UpdateQueryP;
220222

221-
// Min time between query updates (ticks)
223+
// Min time between query updates (millis)
222224
static const int MIN_UPDATE_INTERVAL = 500;
223225

224226
/*
@@ -993,7 +995,7 @@ bindPdhFunctionPointers(HMODULE h) {
993995
*/
994996
static int
995997
getPerformanceData(UpdateQueryP query, HCOUNTER c, PDH_FMT_COUNTERVALUE* value, DWORD format) {
996-
clock_t now = clock();
998+
uint64_t now = GetTickCount64();
997999

9981000
/*
9991001
* Need to limit how often we update the query

test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* VMThreadStackSize values should result in an error message that shows
2929
* the minimum stack size value for each thread type.
3030
* @library /test/lib
31+
* @requires vm.flagless
3132
* @modules java.base/jdk.internal.misc
3233
* java.management
3334
* @run driver TooSmallStackSize
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/*
25+
* @test
26+
* @bug 8169355
27+
* @summary Check if Spanish diacritical signs could be typed for TextField
28+
* @requires (os.family == "windows")
29+
* @library /java/awt/regtesthelpers
30+
* @run main/manual SpanishDiacriticsTest
31+
*/
32+
33+
34+
import java.util.concurrent.locks.LockSupport;
35+
import java.awt.event.KeyAdapter;
36+
import java.awt.event.KeyEvent;
37+
import javax.swing.JFrame;
38+
import javax.swing.JTextField;
39+
import javax.swing.SwingUtilities;
40+
import javax.swing.WindowConstants;
41+
42+
public class SpanishDiacriticsTest {
43+
44+
static final String INSTRUCTIONS = """
45+
This test requires the following keyboard layout to be installed:
46+
Windows OS: Spanish (United States) with 'Latin American' keyboard layout.
47+
If using a US layout, the results should still be as described but
48+
you have not tested the real bug.
49+
50+
1. A frame with a text field should be displayed.
51+
2. Set focus to the text field and switch to Spanish
52+
with 'Latin American' keyboard layout.
53+
3. Type the following: ' ' o - i.e. single quote two times, then o.
54+
If your keyboard has a US physical layout the [ key can be used
55+
to type the single quote when in 'Latin American' keyboard mode.
56+
4. Type these characters at a normal speed but do NOT be concerned
57+
that they take several seconds to display. That is an
58+
expected behaviour for this test.
59+
60+
If the text field displays the same three characters you typed: ''o
61+
(i.e. two single quotes followed by o without an acute)
62+
then press Pass; otherwise press Fail.
63+
""";
64+
65+
public static void main(String[] args) throws Exception {
66+
67+
PassFailJFrame.builder()
68+
.title("Spanish Diacritics")
69+
.instructions(INSTRUCTIONS)
70+
.rows(20)
71+
.columns(50)
72+
.testUI(SpanishDiacriticsTest::createTestUI)
73+
.build()
74+
.awaitAndCheck();
75+
}
76+
77+
static JFrame createTestUI() {
78+
JFrame frame = new JFrame("Spanish Diacritics Test Frame");
79+
JTextField textField = new JTextField(20);
80+
textField.addKeyListener(new KeyAdapter() {
81+
@Override
82+
public void keyTyped(KeyEvent e) {
83+
LockSupport.parkNanos(1_000_000_000L);
84+
}
85+
});
86+
frame.add(textField);
87+
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
88+
frame.pack();
89+
return frame;
90+
}
91+
}
92+

test/jdk/java/awt/InputMethods/SpanishDiacriticsTest/SpanishDiacriticsTest.html

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

test/jdk/java/awt/InputMethods/SpanishDiacriticsTest/SpanishDiacriticsTest.java

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

0 commit comments

Comments
 (0)