Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -3401,7 +3401,7 @@ encode %{
}
%}

/// mov envcodings
// mov encodings

enc_class aarch64_enc_movw_imm(iRegI dst, immI src) %{
C2_MacroAssembler _masm(&cbuf);
Expand Down
25 changes: 24 additions & 1 deletion src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 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
Expand Down Expand Up @@ -226,6 +226,16 @@ class RunExecutorWithMsgLoop {
};


void enableConsoleCtrlHandler(bool enable) {
if (!SetConsoleCtrlHandler(NULL, enable ? FALSE : TRUE)) {
JP_THROW(SysError(tstrings::any() << "SetConsoleCtrlHandler(NULL, "
<< (enable ? "FALSE" : "TRUE")
<< ") failed",
SetConsoleCtrlHandler));
}
}


void launchApp() {
// [RT-31061] otherwise UI can be left in back of other windows.
::AllowSetForegroundWindow(ASFW_ANY);
Expand Down Expand Up @@ -279,6 +289,19 @@ void launchApp() {
exec.arg(arg);
});

exec.afterProcessCreated([&](HANDLE pid) {
//
// Ignore Ctrl+C in the current process.
// This will prevent child process termination without allowing
// it to handle Ctrl+C events.
//
// Disable the default Ctrl+C handler *after* the child process
// has been created as it is inheritable and we want the child
// process to have the default handler.
//
enableConsoleCtrlHandler(false);
});

DWORD exitCode = RunExecutorWithMsgLoop::apply(exec);

exit(exitCode);
Expand Down
6 changes: 5 additions & 1 deletion src/jdk.jpackage/windows/native/common/Executor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 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
Expand Down Expand Up @@ -161,6 +161,10 @@ UniqueHandle Executor::startProcess(UniqueHandle* threadHandle) const {
}
}

if (afterProcessCreatedCallback) {
afterProcessCreatedCallback(processInfo.hProcess);
}

// Return process handle.
return UniqueHandle(processInfo.hProcess);
}
13 changes: 12 additions & 1 deletion src/jdk.jpackage/windows/native/common/Executor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 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
Expand All @@ -26,6 +26,8 @@
#ifndef EXECUTOR_H
#define EXECUTOR_H

#include <functional>

#include "tstrings.h"
#include "UniqueHandle.h"

Expand Down Expand Up @@ -97,6 +99,14 @@ class Executor {
*/
int execAndWaitForExit() const;

/**
* Call provided function after the process hass been created.
*/
Executor& afterProcessCreated(const std::function<void(HANDLE)>& v) {
afterProcessCreatedCallback = v;
return *this;
}

private:
UniqueHandle startProcess(UniqueHandle* threadHandle=0) const;

Expand All @@ -106,6 +116,7 @@ class Executor {
HANDLE jobHandle;
tstring_array argsArray;
std::wstring appPath;
std::function<void(HANDLE)> afterProcessCreatedCallback;
};

#endif // #ifndef EXECUTOR_H
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, 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
Expand Down Expand Up @@ -50,6 +50,8 @@
#include <process.h>
#pragma warning(pop)

#include <sysinfoapi.h>

typedef unsigned __int32 juint;
typedef unsigned __int64 julong;

Expand Down Expand Up @@ -215,10 +217,10 @@ static PdhLookupPerfNameByIndexFunc PdhLookupPerfNameByIndex_i;
*/
typedef struct {
HQUERY query;
uint64_t lastUpdate; // Last time query was updated (ticks)
uint64_t lastUpdate; // Last time query was updated (millis)
} UpdateQueryS, *UpdateQueryP;

// Min time between query updates (ticks)
// Min time between query updates (millis)
static const int MIN_UPDATE_INTERVAL = 500;

/*
Expand Down Expand Up @@ -993,7 +995,7 @@ bindPdhFunctionPointers(HMODULE h) {
*/
static int
getPerformanceData(UpdateQueryP query, HCOUNTER c, PDH_FMT_COUNTERVALUE* value, DWORD format) {
clock_t now = clock();
uint64_t now = GetTickCount64();

/*
* Need to limit how often we update the query
Expand Down
1 change: 1 addition & 0 deletions test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* VMThreadStackSize values should result in an error message that shows
* the minimum stack size value for each thread type.
* @library /test/lib
* @requires vm.flagless
* @modules java.base/jdk.internal.misc
* java.management
* @run driver TooSmallStackSize
Expand Down
92 changes: 92 additions & 0 deletions test/jdk/java/awt/InputMethods/SpanishDiacriticsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright (c) 2016, 2024, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

/*
* @test
* @bug 8169355
* @summary Check if Spanish diacritical signs could be typed for TextField
* @requires (os.family == "windows")
* @library /java/awt/regtesthelpers
* @run main/manual SpanishDiacriticsTest
*/


import java.util.concurrent.locks.LockSupport;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;

public class SpanishDiacriticsTest {

static final String INSTRUCTIONS = """
This test requires the following keyboard layout to be installed:
Windows OS: Spanish (United States) with 'Latin American' keyboard layout.
If using a US layout, the results should still be as described but
you have not tested the real bug.

1. A frame with a text field should be displayed.
2. Set focus to the text field and switch to Spanish
with 'Latin American' keyboard layout.
3. Type the following: ' ' o - i.e. single quote two times, then o.
If your keyboard has a US physical layout the [ key can be used
to type the single quote when in 'Latin American' keyboard mode.
4. Type these characters at a normal speed but do NOT be concerned
that they take several seconds to display. That is an
expected behaviour for this test.

If the text field displays the same three characters you typed: ''o
(i.e. two single quotes followed by o without an acute)
then press Pass; otherwise press Fail.
""";

public static void main(String[] args) throws Exception {

PassFailJFrame.builder()
.title("Spanish Diacritics")
.instructions(INSTRUCTIONS)
.rows(20)
.columns(50)
.testUI(SpanishDiacriticsTest::createTestUI)
.build()
.awaitAndCheck();
}

static JFrame createTestUI() {
JFrame frame = new JFrame("Spanish Diacritics Test Frame");
JTextField textField = new JTextField(20);
textField.addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
LockSupport.parkNanos(1_000_000_000L);
}
});
frame.add(textField);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
return frame;
}
}

This file was deleted.

This file was deleted.

Loading
Loading