Skip to content

Commit 654c7d5

Browse files
authored
Merge pull request #2171 from SAP/pr-jdk-27+8
Merge to tag jdk-27+8
2 parents 830ec8b + 949370a commit 654c7d5

File tree

633 files changed

+26350
-17111
lines changed

Some content is hidden

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

633 files changed

+26350
-17111
lines changed

bin/update_copyright_year.sh

Lines changed: 100 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash -f
22

33
#
4-
# Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved.
4+
# Copyright (c) 2010, 2026, Oracle and/or its affiliates. All rights reserved.
55
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
66
#
77
# This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,13 @@
2323
# questions.
2424
#
2525

26-
# Script to update the Copyright YEAR range in Mercurial & Git sources.
26+
# Script to update the Copyright YEAR range in Git sources.
2727
# (Originally from xdono, Thanks!)
2828

29+
# To update Copyright years for changes in a specific branch,
30+
# you use a command along these lines:
31+
# $ git diff upstream/master...<branch-name> | lsdiff | cut -d '/' -f 2- | bash bin/update_copyright_year.sh -m -
32+
2933
#------------------------------------------------------------
3034
copyright="Copyright"
3135
copyright_symbol="(c)"
@@ -47,7 +51,7 @@ rm -f -r ${tmp}
4751
mkdir -p ${tmp}
4852
total=0
4953

50-
usage="Usage: `basename "$0"` [-c company] [-y year] [-h|f]"
54+
usage="Usage: `basename "$0"` [-c company] [-y year] [-m file] [-h|f]"
5155
Help()
5256
{
5357
# Display Help
@@ -65,15 +69,18 @@ Help()
6569
echo "-b Specifies the base reference for change set lookup."
6670
echo "-f Updates the copyright for all change sets in a given year,"
6771
echo " as specified by -y. Overrides -b flag."
72+
echo "-m Read the list of modified files from the given file,"
73+
echo " use - to read from stdin"
6874
echo "-h Print this help."
6975
echo
7076
}
7177

7278
full_year=false
7379
base_reference=master
80+
modified_files_origin="";
7481

7582
# Process options
76-
while getopts "b:c:fhy:" option; do
83+
while getopts "b:c:fhm:y:" option; do
7784
case $option in
7885
b) # supplied base reference
7986
base_reference=${OPTARG}
@@ -91,6 +98,9 @@ while getopts "b:c:fhy:" option; do
9198
y) # supplied company year
9299
year=${OPTARG}
93100
;;
101+
m) # modified files will be read from the given origin
102+
modified_files_origin="${OPTARG}"
103+
;;
94104
\?) # illegal option
95105
echo "$usage"
96106
exit 1
@@ -110,18 +120,10 @@ git status &> /dev/null && git_found=true
110120
if [ "$git_found" != "true" ]; then
111121
echo "Error: Please execute script from within a JDK git repository."
112122
exit 1
113-
else
114-
echo "Using Git version control system"
115-
vcs_status=(git ls-files -m)
116-
if [ "$full_year" = "true" ]; then
117-
vcs_list_changesets=(git log --no-merges --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
118-
else
119-
vcs_list_changesets=(git log --no-merges "${base_reference}..HEAD" --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
120-
fi
121-
vcs_changeset_message=(git log -1 --pretty=tformat:"%B") # followed by ${changeset}
122-
vcs_changeset_files=(git diff-tree --no-commit-id --name-only -r) # followed by ${changeset}
123123
fi
124124

125+
echo "Using Git version control system"
126+
125127
# Return true if it makes sense to edit this file
126128
saneFileToCheck()
127129
{
@@ -168,6 +170,25 @@ updateFile() # file
168170
echo "${changed}"
169171
}
170172

173+
# Update the copyright year on files sent in stdin
174+
updateFiles() # stdin: list of files to update
175+
{
176+
count=0
177+
fcount=0
178+
while read i; do
179+
fcount=`expr ${fcount} '+' 1`
180+
if [ `updateFile "${i}"` = "true" ] ; then
181+
count=`expr ${count} '+' 1`
182+
fi
183+
done
184+
if [ ${count} -gt 0 ] ; then
185+
printf " UPDATED year on %d of %d files.\n" ${count} ${fcount}
186+
total=`expr ${total} '+' ${count}`
187+
else
188+
printf " None of the %d files were changed.\n" ${fcount}
189+
fi
190+
}
191+
171192
# Update the copyright year on all files changed by this changeset
172193
updateChangesetFiles() # changeset
173194
{
@@ -178,18 +199,7 @@ updateChangesetFiles() # changeset
178199
| ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}' \
179200
> ${files}
180201
if [ -f "${files}" -a -s "${files}" ] ; then
181-
fcount=`cat ${files}| wc -l`
182-
for i in `cat ${files}` ; do
183-
if [ `updateFile "${i}"` = "true" ] ; then
184-
count=`expr ${count} '+' 1`
185-
fi
186-
done
187-
if [ ${count} -gt 0 ] ; then
188-
printf " UPDATED year on %d of %d files.\n" ${count} ${fcount}
189-
total=`expr ${total} '+' ${count}`
190-
else
191-
printf " None of the %d files were changed.\n" ${fcount}
192-
fi
202+
cat ${files} | updateFiles
193203
else
194204
printf " ERROR: No files changed in the changeset? Must be a mistake.\n"
195205
set -x
@@ -204,67 +214,80 @@ updateChangesetFiles() # changeset
204214
}
205215

206216
# Check if repository is clean
217+
vcs_status=(git ls-files -m)
207218
previous=`"${vcs_status[@]}"|wc -l`
208219
if [ ${previous} -ne 0 ] ; then
209220
echo "WARNING: This repository contains previously edited working set files."
210221
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
211222
fi
212223

213-
# Get all changesets this year
214-
all_changesets=${tmp}/all_changesets
215-
rm -f ${all_changesets}
216-
"${vcs_list_changesets[@]}" > ${all_changesets}
224+
if [ "x$modified_files_origin" != "x" ]; then
225+
cat $modified_files_origin | updateFiles
226+
else
227+
# Get all changesets this year
228+
if [ "$full_year" = "true" ]; then
229+
vcs_list_changesets=(git log --no-merges --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
230+
else
231+
vcs_list_changesets=(git log --no-merges "${base_reference}..HEAD" --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
232+
fi
233+
vcs_changeset_message=(git log -1 --pretty=tformat:"%B") # followed by ${changeset}
234+
vcs_changeset_files=(git diff-tree --no-commit-id --name-only -r) # followed by ${changeset}
217235

218-
# Check changeset to see if it is Copyright only changes, filter changesets
219-
if [ -s ${all_changesets} ] ; then
220-
echo "Changesets made in ${year}: `cat ${all_changesets} | wc -l`"
221-
index=0
222-
cat ${all_changesets} | while read changeset ; do
223-
index=`expr ${index} '+' 1`
224-
desc=${tmp}/desc.${changeset}
225-
rm -f ${desc}
226-
echo "------------------------------------------------"
227-
"${vcs_changeset_message[@]}" "${changeset}" > ${desc}
228-
printf "%d: %s\n%s\n" ${index} "${changeset}" "`cat ${desc}|head -1`"
229-
if [ "${year}" = "2010" ] ; then
230-
if cat ${desc} | grep -i -F "Added tag" > /dev/null ; then
231-
printf " EXCLUDED tag changeset.\n"
232-
elif cat ${desc} | grep -i -F rebrand > /dev/null ; then
233-
printf " EXCLUDED rebrand changeset.\n"
234-
elif cat ${desc} | grep -i -F copyright > /dev/null ; then
235-
printf " EXCLUDED copyright changeset.\n"
236-
else
237-
updateChangesetFiles ${changeset}
238-
fi
239-
else
240-
if cat ${desc} | grep -i -F "Added tag" > /dev/null ; then
241-
printf " EXCLUDED tag changeset.\n"
242-
elif cat ${desc} | grep -i -F "copyright year" > /dev/null ; then
243-
printf " EXCLUDED copyright year changeset.\n"
236+
all_changesets=${tmp}/all_changesets
237+
rm -f ${all_changesets}
238+
"${vcs_list_changesets[@]}" > ${all_changesets}
239+
240+
# Check changeset to see if it is Copyright only changes, filter changesets
241+
if [ -s ${all_changesets} ] ; then
242+
echo "Changesets made in ${year}: `cat ${all_changesets} | wc -l`"
243+
index=0
244+
cat ${all_changesets} | while read changeset ; do
245+
index=`expr ${index} '+' 1`
246+
desc=${tmp}/desc.${changeset}
247+
rm -f ${desc}
248+
echo "------------------------------------------------"
249+
"${vcs_changeset_message[@]}" "${changeset}" > ${desc}
250+
printf "%d: %s\n%s\n" ${index} "${changeset}" "`cat ${desc}|head -1`"
251+
if [ "${year}" = "2010" ] ; then
252+
if cat ${desc} | grep -i -F "Added tag" > /dev/null ; then
253+
printf " EXCLUDED tag changeset.\n"
254+
elif cat ${desc} | grep -i -F rebrand > /dev/null ; then
255+
printf " EXCLUDED rebrand changeset.\n"
256+
elif cat ${desc} | grep -i -F copyright > /dev/null ; then
257+
printf " EXCLUDED copyright changeset.\n"
258+
else
259+
updateChangesetFiles ${changeset}
260+
fi
244261
else
245-
updateChangesetFiles ${changeset}
262+
if cat ${desc} | grep -i -F "Added tag" > /dev/null ; then
263+
printf " EXCLUDED tag changeset.\n"
264+
elif cat ${desc} | grep -i -F "copyright year" > /dev/null ; then
265+
printf " EXCLUDED copyright year changeset.\n"
266+
else
267+
updateChangesetFiles ${changeset}
268+
fi
246269
fi
247-
fi
248-
rm -f ${desc}
249-
done
250-
fi
270+
rm -f ${desc}
271+
done
272+
fi
251273

252-
if [ ${total} -gt 0 ] ; then
253-
echo "---------------------------------------------"
254-
echo "Updated the copyright year on a total of ${total} files."
255-
if [ ${previous} -eq 0 ] ; then
256-
echo "This count should match the count of modified files in the repository: ${vcs_status[*]}"
257-
else
258-
echo "WARNING: This repository contained previously edited working set files."
259-
fi
260-
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
261-
else
262-
echo "---------------------------------------------"
263-
echo "No files were changed"
264-
if [ ${previous} -ne 0 ] ; then
265-
echo "WARNING: This repository contained previously edited working set files."
266-
fi
267-
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
274+
if [ ${total} -gt 0 ] ; then
275+
echo "---------------------------------------------"
276+
echo "Updated the copyright year on a total of ${total} files."
277+
if [ ${previous} -eq 0 ] ; then
278+
echo "This count should match the count of modified files in the repository: ${vcs_status[*]}"
279+
else
280+
echo "WARNING: This repository contained previously edited working set files."
281+
fi
282+
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
283+
else
284+
echo "---------------------------------------------"
285+
echo "No files were changed"
286+
if [ ${previous} -ne 0 ] ; then
287+
echo "WARNING: This repository contained previously edited working set files."
288+
fi
289+
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
290+
fi
268291
fi
269292

270293
# Cleanup

doc/building.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,10 +1385,9 @@ <h4 id="alsa-1">ALSA</h4>
13851385
can specify it by <code>--with-alsa</code>.</p></li>
13861386
</ul>
13871387
<h4 id="x11-1">X11</h4>
1388-
<p>You will need X11 libraries suitable for your <em>target</em> system.
1389-
In most cases, using Debian's pre-built libraries work fine.</p>
1390-
<p>Note that X11 is needed even if you only want to build a headless
1391-
JDK.</p>
1388+
<p>When not building a headless JDK, you will need X11 libraries
1389+
suitable for your <em>target</em> system. In most cases, using Debian's
1390+
pre-built libraries work fine.</p>
13921391
<ul>
13931392
<li><p>Go to <a href="https://www.debian.org/distrib/packages">Debian
13941393
Package Search</a>, search for the following packages for your

doc/building.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,10 +1178,8 @@ Note that alsa is needed even if you only want to build a headless JDK.
11781178

11791179
#### X11
11801180

1181-
You will need X11 libraries suitable for your *target* system. In most cases,
1182-
using Debian's pre-built libraries work fine.
1183-
1184-
Note that X11 is needed even if you only want to build a headless JDK.
1181+
When not building a headless JDK, you will need X11 libraries suitable for your
1182+
*target* system. In most cases, using Debian's pre-built libraries work fine.
11851183

11861184
* Go to [Debian Package Search](https://www.debian.org/distrib/packages),
11871185
search for the following packages for your *target* system, and download them

make/RunTests.gmk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2026, 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
@@ -972,6 +972,10 @@ define SetupRunJtregTestBody
972972
JTREG_AUTO_PROBLEM_LISTS += ProblemList-enable-preview.txt
973973
endif
974974

975+
ifneq ($$(findstring -XX:+UseCompactObjectHeaders, $$(JTREG_ALL_OPTIONS)), )
976+
JTREG_AUTO_PROBLEM_LISTS += ProblemList-coh.txt
977+
endif
978+
975979

976980
ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
977981
# Accept both absolute paths as well as relative to the current test root.

make/autoconf/libraries.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ m4_include([lib-tests.m4])
4242
AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
4343
[
4444
# Check if X11 is needed
45-
if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
46-
# No X11 support on windows or macosx
45+
if test "x$OPENJDK_TARGET_OS" = xwindows ||
46+
test "x$OPENJDK_TARGET_OS" = xmacosx ||
47+
test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
4748
NEEDS_LIB_X11=false
4849
else
49-
# All other instances need X11, even if building headless only, libawt still
50-
# needs X11 headers.
50+
# All other instances need X11 for libawt.
5151
NEEDS_LIB_X11=true
5252
fi
5353

make/modules/java.desktop/lib/AwtLibraries.gmk

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ LIBAWT_EXTRA_HEADER_DIRS := \
8888

8989
LIBAWT_CFLAGS := -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES -DMLIB_NO_LIBSUNMATH
9090

91+
ifeq ($(ENABLE_HEADLESS_ONLY), true)
92+
LIBAWT_CFLAGS += -DHEADLESS
93+
endif
94+
9195
ifeq ($(call isTargetOs, windows), true)
9296
LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE -DMLIB_OS64BIT
9397
LIBAWT_RCFLAGS ?= -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
@@ -167,11 +171,18 @@ ifeq ($(call isTargetOs, windows macosx), false)
167171
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
168172
#
169173

174+
LIBAWT_HEADLESS_EXCLUDE_FILES := \
175+
GLXGraphicsConfig.c \
176+
GLXSurfaceData.c \
177+
X11PMBlitLoops.c \
178+
X11Renderer.c \
179+
X11SurfaceData.c \
180+
#
181+
170182
LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
171183
$(LIBAWT_DEFAULT_HEADER_DIRS) \
172184
common/awt/debug \
173185
common/font \
174-
common/java2d/opengl \
175186
java.base:libjvm \
176187
#
177188

@@ -191,7 +202,8 @@ ifeq ($(call isTargetOs, windows macosx), false)
191202
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
192203
NAME := awt_headless, \
193204
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
194-
EXCLUDES := medialib, \
205+
EXCLUDES := medialib opengl, \
206+
EXCLUDE_FILES := $(LIBAWT_HEADLESS_EXCLUDE_FILES), \
195207
ONLY_EXPORTED := $(LIBAWT_HEADLESS_ONLY_EXPORTED), \
196208
OPTIMIZATION := LOW, \
197209
CFLAGS := -DHEADLESS=true $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) \

0 commit comments

Comments
 (0)