Skip to content

Commit e3130f7

Browse files
authored
Merge branch 'openjdk:master' into backport-sendaoYan-fe29cad5-master
2 parents 675e716 + f4c80e3 commit e3130f7

File tree

91 files changed

+1558
-444
lines changed

Some content is hidden

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

91 files changed

+1558
-444
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -325,46 +325,3 @@ jobs:
325325
bootjdk-platform: windows-x64
326326
runs-on: windows-2025
327327

328-
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
329-
remove-bundles:
330-
name: 'Remove bundle artifacts'
331-
runs-on: ubuntu-22.04
332-
if: always()
333-
needs:
334-
- build-linux-x64
335-
- build-linux-x86-hs
336-
- build-linux-x64-hs-nopch
337-
- build-linux-x64-hs-zero
338-
- build-linux-x64-hs-minimal
339-
- build-linux-x64-hs-optimized
340-
- build-linux-cross-compile
341-
- build-macos-x64
342-
- build-macos-aarch64
343-
- build-windows-x64
344-
- build-windows-aarch64
345-
- test-linux-x64
346-
- test-macos-x64
347-
- test-macos-aarch64
348-
- test-windows-x64
349-
350-
steps:
351-
- name: 'Remove bundle artifacts'
352-
run: |
353-
# Find and remove all bundle artifacts
354-
# See: https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28
355-
ALL_ARTIFACT_IDS="$(curl -sL \
356-
-H 'Accept: application/vnd.github+json' \
357-
-H 'Authorization: Bearer ${{ github.token }}' \
358-
-H 'X-GitHub-Api-Version: 2022-11-28' \
359-
'${{ github.api_url }}/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts?per_page=100')"
360-
BUNDLE_ARTIFACT_IDS="$(echo "$ALL_ARTIFACT_IDS" | jq -r -c '.artifacts | map(select(.name|startswith("bundles-"))) | .[].id')"
361-
for id in $BUNDLE_ARTIFACT_IDS; do
362-
echo "Removing $id"
363-
curl -sL \
364-
-X DELETE \
365-
-H 'Accept: application/vnd.github+json' \
366-
-H 'Authorization: Bearer ${{ github.token }}' \
367-
-H 'X-GitHub-Api-Version: 2022-11-28' \
368-
"${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/$id" \
369-
|| echo "Failed to remove bundle"
370-
done

make/autoconf/flags-cflags.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
544544
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced \
545545
-qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect"
546546
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
547-
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -MP"
548-
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:wchar_t-"
547+
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:strictStrings -MP"
548+
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:strictStrings -Zc:wchar_t-"
549549
fi
550550
551551
# CFLAGS C language level for JDK sources (hotspot only uses C++)

src/hotspot/os/windows/os_windows.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4547,7 +4547,7 @@ static errno_t get_full_path(LPCWSTR unicode_path, LPWSTR* full_path) {
45474547
return ERROR_SUCCESS;
45484548
}
45494549

4550-
static void set_path_prefix(char* buf, LPWSTR* prefix, int* prefix_off, bool* needs_fullpath) {
4550+
static void set_path_prefix(char* buf, LPCWSTR* prefix, int* prefix_off, bool* needs_fullpath) {
45514551
*prefix_off = 0;
45524552
*needs_fullpath = true;
45534553

@@ -4583,7 +4583,7 @@ static wchar_t* wide_abs_unc_path(char const* path, errno_t & err, int additiona
45834583
strncpy(buf, path, buf_len);
45844584
os::native_path(buf);
45854585

4586-
LPWSTR prefix = NULL;
4586+
LPCWSTR prefix = NULL;
45874587
int prefix_off = 0;
45884588
bool needs_fullpath = true;
45894589
set_path_prefix(buf, &prefix, &prefix_off, &needs_fullpath);

src/hotspot/share/c1/c1_Canonicalizer.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2023, 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
@@ -40,10 +40,6 @@ class Canonicalizer: InstructionVisitor {
4040
void set_constant(jlong x) { set_canonical(new Constant(new LongConstant(x))); }
4141
void set_constant(jfloat x) { set_canonical(new Constant(new FloatConstant(x))); }
4242
void set_constant(jdouble x) { set_canonical(new Constant(new DoubleConstant(x))); }
43-
#ifdef _WINDOWS
44-
// jint is defined as long in jni_md.h, so convert from int to jint
45-
void set_constant(int x) { set_constant((jint)x); }
46-
#endif
4743
void move_const_to_right(Op2* x);
4844
void do_Op2(Op2* x);
4945
void do_UnsafeRawOp(UnsafeRawOp* x);

src/java.base/share/classes/java/net/InMemoryCookieStore.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 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
@@ -25,10 +25,6 @@
2525

2626
package java.net;
2727

28-
import java.net.URI;
29-
import java.net.CookieStore;
30-
import java.net.HttpCookie;
31-
import java.net.URISyntaxException;
3228
import java.util.List;
3329
import java.util.Map;
3430
import java.util.ArrayList;
@@ -72,6 +68,7 @@ public InMemoryCookieStore() {
7268
/**
7369
* Add one cookie into cookie store.
7470
*/
71+
@Override
7572
public void add(URI uri, HttpCookie cookie) {
7673
// pre-condition : argument can't be null
7774
if (cookie == null) {
@@ -109,6 +106,7 @@ public void add(URI uri, HttpCookie cookie) {
109106
* 3) not expired.
110107
* See RFC 2965 sec. 3.3.4 for more detail.
111108
*/
109+
@Override
112110
public List<HttpCookie> get(URI uri) {
113111
// argument can't be null
114112
if (uri == null) {
@@ -127,12 +125,13 @@ public List<HttpCookie> get(URI uri) {
127125
lock.unlock();
128126
}
129127

130-
return cookies;
128+
return Collections.unmodifiableList(cookies);
131129
}
132130

133131
/**
134132
* Get all cookies in cookie store, except those have expired
135133
*/
134+
@Override
136135
public List<HttpCookie> getCookies() {
137136
List<HttpCookie> rt;
138137

@@ -156,6 +155,7 @@ public List<HttpCookie> getCookies() {
156155
* Get all URIs, which are associated with at least one cookie
157156
* of this cookie store.
158157
*/
158+
@Override
159159
public List<URI> getURIs() {
160160
List<URI> uris = new ArrayList<>();
161161

@@ -165,7 +165,7 @@ public List<URI> getURIs() {
165165
while (it.hasNext()) {
166166
URI uri = it.next();
167167
List<HttpCookie> cookies = uriIndex.get(uri);
168-
if (cookies == null || cookies.size() == 0) {
168+
if (cookies == null || cookies.isEmpty()) {
169169
// no cookies list or an empty list associated with
170170
// this uri entry, delete it
171171
it.remove();
@@ -176,13 +176,14 @@ public List<URI> getURIs() {
176176
lock.unlock();
177177
}
178178

179-
return uris;
179+
return Collections.unmodifiableList(uris);
180180
}
181181

182182

183183
/**
184184
* Remove a cookie from store
185185
*/
186+
@Override
186187
public boolean remove(URI uri, HttpCookie ck) {
187188
// argument can't be null
188189
if (ck == null) {
@@ -204,6 +205,7 @@ public boolean remove(URI uri, HttpCookie ck) {
204205
/**
205206
* Remove all cookies in this cookie store.
206207
*/
208+
@Override
207209
public boolean removeAll() {
208210
lock.lock();
209211
try {

src/java.base/share/classes/java/util/SimpleTimeZone.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 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
@@ -112,15 +112,15 @@
112112
* <pre><code>
113113
* // Base GMT offset: -8:00
114114
* // DST starts: at 2:00am in standard time
115-
* // on the first Sunday in April
115+
* // on the second Sunday in March
116116
* // DST ends: at 2:00am in daylight time
117-
* // on the last Sunday in October
117+
* // on the first Sunday in November
118118
* // Save: 1 hour
119119
* SimpleTimeZone(-28800000,
120120
* "America/Los_Angeles",
121-
* Calendar.APRIL, 1, -Calendar.SUNDAY,
121+
* Calendar.MARCH, 8, -Calendar.SUNDAY,
122122
* 7200000,
123-
* Calendar.OCTOBER, -1, Calendar.SUNDAY,
123+
* Calendar.NOVEMBER, 1, -Calendar.SUNDAY,
124124
* 7200000,
125125
* 3600000)
126126
*
@@ -857,13 +857,24 @@ public Object clone()
857857
}
858858

859859
/**
860-
* Generates the hash code for the SimpleDateFormat object.
860+
* Generates the hash code for the SimpleTimeZone object.
861861
* @return the hash code for this object
862862
*/
863863
public int hashCode()
864864
{
865-
return startMonth ^ startDay ^ startDayOfWeek ^ startTime ^
866-
endMonth ^ endDay ^ endDayOfWeek ^ endTime ^ rawOffset;
865+
int hash = 31 * getID().hashCode() + rawOffset;
866+
hash = 31 * hash + Boolean.hashCode(useDaylight);
867+
if (useDaylight) {
868+
hash = 31 * hash + startMonth;
869+
hash = 31 * hash + startDay;
870+
hash = 31 * hash + startDayOfWeek;
871+
hash = 31 * hash + startTime;
872+
hash = 31 * hash + endMonth;
873+
hash = 31 * hash + endDay;
874+
hash = 31 * hash + endDayOfWeek;
875+
hash = 31 * hash + endTime;
876+
}
877+
return hash;
867878
}
868879

869880
/**

src/java.base/windows/native/include/jni_md.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2023, 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
@@ -32,9 +32,8 @@
3232
#define JNIIMPORT __declspec(dllimport)
3333
#define JNICALL __stdcall
3434

35-
// 'long' is always 32 bit on windows so this matches what jdk expects
36-
typedef long jint;
37-
typedef __int64 jlong;
35+
typedef int jint;
36+
typedef long long jlong;
3837
typedef signed char jbyte;
3938

4039
#endif /* !_JAVASOFT_JNI_MD_H_ */

src/java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2023, 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
@@ -49,7 +49,7 @@ extern "C" {
4949

5050
#define POLYTEMPSIZE (512 / sizeof(POINT))
5151

52-
static void AngleToCoord(jint angle, jint w, jint h, jint *x, jint *y)
52+
static void AngleToCoord(int angle, int w, int h, int *x, int *y)
5353
{
5454
const double pi = 3.1415926535;
5555
const double toRadians = 2 * pi / 360;
@@ -322,7 +322,7 @@ Java_sun_java2d_windows_GDIRenderer_doDrawArc
322322
return;
323323
}
324324

325-
long sx, sy, ex, ey;
325+
int sx, sy, ex, ey;
326326
if (angleExtent >= 360 || angleExtent <= -360) {
327327
sx = ex = x + w;
328328
sy = ey = y + h/2;
@@ -602,7 +602,7 @@ Java_sun_java2d_windows_GDIRenderer_doFillArc
602602
if (wsdo == NULL) {
603603
return;
604604
}
605-
long sx, sy, ex, ey;
605+
int sx, sy, ex, ey;
606606
int angleEnd;
607607
if (angleExtent < 0) {
608608
angleEnd = angleStart;

src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2023, 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
@@ -897,7 +897,7 @@ static void GDIWinSD_GetRasInfo(JNIEnv *env,
897897
}
898898
if (wsdo->lockFlags & SD_LOCK_LUT) {
899899
pRasInfo->lutBase =
900-
(long *) wsdo->device->GetSystemPaletteEntries();
900+
(jint *) wsdo->device->GetSystemPaletteEntries();
901901
pRasInfo->lutSize = 256;
902902
} else {
903903
pRasInfo->lutBase = NULL;

src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,12 +1080,12 @@ JNIEXPORT jintArray JNICALL Java_sun_awt_shell_Win32ShellFolder2_getIconBits
10801080
// Extract the color bitmap
10811081
int nBits = iconSize * iconSize;
10821082

1083-
long *colorBits = NULL;
1084-
long *maskBits = NULL;
1083+
jint *colorBits = NULL;
1084+
int *maskBits = NULL;
10851085

10861086
try {
10871087
entry_point();
1088-
colorBits = (long*)safe_Malloc(MAX_ICON_SIZE * MAX_ICON_SIZE * sizeof(long));
1088+
colorBits = (jint*)safe_Malloc(MAX_ICON_SIZE * MAX_ICON_SIZE * sizeof(jint));
10891089
GetDIBits(dc, iconInfo.hbmColor, 0, iconSize, colorBits, &bmi, DIB_RGB_COLORS);
10901090
// XP supports alpha in some icons, and depending on device.
10911091
// This should take precedence over the icon mask bits.
@@ -1100,7 +1100,7 @@ JNIEXPORT jintArray JNICALL Java_sun_awt_shell_Win32ShellFolder2_getIconBits
11001100
}
11011101
if (!hasAlpha) {
11021102
// Extract the mask bitmap
1103-
maskBits = (long*)safe_Malloc(MAX_ICON_SIZE * MAX_ICON_SIZE * sizeof(long));
1103+
maskBits = (int*)safe_Malloc(MAX_ICON_SIZE * MAX_ICON_SIZE * sizeof(int));
11041104
GetDIBits(dc, iconInfo.hbmMask, 0, iconSize, maskBits, &bmi, DIB_RGB_COLORS);
11051105
// Copy the mask alphas into the color bits
11061106
for (int i = 0; i < nBits; i++) {

0 commit comments

Comments
 (0)