Skip to content

Commit 41e3baf

Browse files
committed
Merge remote-tracking branch 'upstream/master' into colormgmt
2 parents ae06f5a + 1fb8755 commit 41e3baf

File tree

84 files changed

+6961
-96
lines changed

Some content is hidden

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

84 files changed

+6961
-96
lines changed

.github/workflows/submit.yml

+89-1
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@
2525

2626
#
2727
# This GitHub actions YAML file runs a build and test on each of the three primary platforms:
28-
# Linux, macOS, Windows. The jobs are run using the default (latest) OS platform for each OS.
28+
# Linux, macOS (both x64 and aarch64), Windows. The jobs are run using the default (latest) OS platform for each OS.
2929
# We download a specific version the boot JDK and gradle. We use the default versions
3030
# of all other build tools (e.g., compilers and ant) that are available on each platform.
3131
#
3232
# The build step is run in the default mode without building the native media or webkit libraries.
3333
# The test is run with web tests excluded. As a follow-up enhancement, we might consider optionally
3434
# building the media and webkit libraries.
3535
#
36+
# NOTE: much of the build logic is duplicated for each platform. Keep this in mind when making changes.
37+
#
3638

3739
name: JavaFX pre-submit tests
3840

@@ -228,6 +230,92 @@ jobs:
228230
bash gradlew --info --continue -PTEST_ONLY=true test -x :web:test
229231
230232
233+
macos_aarch64_build:
234+
name: macOS aarch64
235+
needs: validation
236+
runs-on: "macos-14"
237+
238+
env:
239+
# FIXME: read this information from a property file
240+
# BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
241+
# BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
242+
# BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
243+
# BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
244+
BOOT_JDK_VERSION: "21.0.2"
245+
BOOT_JDK_FILENAME: "jdk-21.0.2_macos-aarch64_bin.tar.gz"
246+
BOOT_JDK_URL: "https://download.oracle.com/java/21/archive/jdk-21.0.2_macos-aarch64_bin.tar.gz"
247+
# Disabled due to timeout downloading ant; use ant installed on system
248+
#ANT_DIR: "apache-ant-1.10.5"
249+
#ANT_FILENAME: "apache-ant-1.10.5.tar.gz"
250+
#ANT_URL: "https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz"
251+
252+
steps:
253+
- name: Checkout the source
254+
uses: actions/checkout@v2
255+
with:
256+
path: jfx
257+
258+
- name: Install dependencies
259+
run: |
260+
set -x
261+
echo "NOT NEEDED: brew install make"
262+
echo "NOT NEEDED: wget ... ant"
263+
#mkdir -p "${HOME}/build-tools"
264+
#wget -O "${HOME}/build-tools/${ANT_FILENAME}" "${ANT_URL}"
265+
#tar -zxf "${HOME}/build-tools/${ANT_FILENAME}" -C "${HOME}/build-tools"
266+
267+
# FIXME: enable cache for boot JDK
268+
# - name: Restore boot JDK from cache
269+
# id: bootjdk
270+
# uses: actions/cache@v2
271+
# with:
272+
# path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
273+
# key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
274+
275+
- name: Download boot JDK
276+
run: |
277+
set -x
278+
mkdir -p "${HOME}/bootjdk"
279+
wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
280+
# FIXME: sha256sum
281+
tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk"
282+
# FIXME: enable cache for boot JDK
283+
284+
- name: Setup environment
285+
run: |
286+
set -x
287+
export JAVA_HOME="${HOME}/bootjdk/jdk-${BOOT_JDK_VERSION}.jdk/Contents/Home"
288+
echo "JAVA_HOME=${JAVA_HOME}" >> "${GITHUB_ENV}"
289+
#export ANT_HOME="${HOME}/build-tools/${ANT_DIR}"
290+
#echo "ANT_HOME=${ANT_HOME}" >> "${GITHUB_ENV}"
291+
#export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
292+
export PATH="$JAVA_HOME/bin:$PATH"
293+
env | sort
294+
which java
295+
java -version
296+
which ant
297+
ant -version
298+
sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
299+
xcodebuild -version
300+
301+
- name: Build JavaFX artifacts
302+
working-directory: jfx
303+
run: |
304+
set -x
305+
#export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
306+
export PATH="$JAVA_HOME/bin:$PATH"
307+
bash gradlew -version
308+
bash gradlew --info all
309+
310+
- name: Run JavaFX headless tests
311+
working-directory: jfx
312+
run: |
313+
set -x
314+
#export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
315+
export PATH="$JAVA_HOME/bin:$PATH"
316+
bash gradlew --info --continue -PTEST_ONLY=true test -x :web:test
317+
318+
231319
windows_x64_build:
232320
name: Windows x64
233321
needs: validation

.jcheck/conf

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ tags=(jdk-){0,1}([1-9]([0-9]*)(\.(0|[1-9][0-9]*)){0,3})(\+(([0-9]+))|(-ga))|[1-9
3131

3232
[checks]
3333
error=author,reviewers,merge,message,issues,whitespace,executable
34+
warning=issuestitle,binary
3435

3536
[census]
3637
version=0

build.gradle

+120-12
Original file line numberDiff line numberDiff line change
@@ -546,12 +546,46 @@ ext.IS_RELEASE = !ext.IS_DEBUG_JAVA
546546
defineProperty("MAVEN_PUBLISH", "false")
547547
ext.IS_MAVEN_PUBLISH = Boolean.parseBoolean(MAVEN_PUBLISH)
548548

549-
// Defines the compiler warning levels to use. If empty, then no warnings are generated. If
550-
// not empty, then the expected syntax is as a space or comma separated list of names, such
551-
// as defined in the javac documentation.
552-
defineProperty("LINT", "none")
553-
ext.IS_LINT = LINT != "none"
549+
// Define the compiler lint warnings to enable.
550+
//
551+
// We define a separate set of options for normal classes, test classes
552+
// (including shims), and tool classes (including JSLC).
553+
// A project (module) can add project-specific lint options for each
554+
// category if desired.
555+
// extraLintOptions
556+
// extraToolLintOptions
557+
// extraTestLintOptions
558+
//
559+
// The lint options can be overriden on the command line. If set to the
560+
// empty string, then no lint warnings are enabled; even project-specific
561+
// lint options are disabled. If not empty, then it is parsed as a space
562+
// or comma separated list of names. See the javac documentation for a list
563+
// of valid lint options.
564+
565+
def defaultLintOptions =
566+
"removal" + "," +
567+
"missing-explicit-ctor"
568+
defineProperty("LINT", defaultLintOptions)
569+
ext.IS_LINT = LINT != ""
570+
571+
def defaultToolLintOptions = ""
572+
defineProperty("TOOL_LINT", defaultToolLintOptions)
573+
ext.IS_TOOL_LINT = TOOL_LINT != ""
574+
575+
def defaultTestLintOptions = ""
576+
defineProperty("TEST_LINT", defaultTestLintOptions)
577+
ext.IS_TEST_LINT = TEST_LINT != ""
578+
579+
defineProperty("JAVAC_WERROR", "true")
580+
ext.IS_JAVAC_WERROR = Boolean.parseBoolean(JAVAC_WERROR)
581+
582+
defineProperty("TOOL_JAVAC_WERROR", "false")
583+
ext.IS_TOOL_JAVAC_WERROR = Boolean.parseBoolean(TOOL_JAVAC_WERROR)
554584

585+
defineProperty("TEST_JAVAC_WERROR", "false")
586+
ext.IS_TEST_JAVAC_WERROR = Boolean.parseBoolean(TEST_JAVAC_WERROR)
587+
588+
// Doclint options (all enabled by default)
555589
defineProperty("DOC_LINT", "all")
556590
ext.IS_DOC_LINT = DOC_LINT != ""
557591

@@ -1731,7 +1765,7 @@ void addMavenPublication(Project project, List<String> projectDependencies) {
17311765
afterEvaluate {
17321766
artifact project.tasks."moduleEmptyPublicationJar$t.capital"
17331767
artifact project.tasks."modularPublicationJar$t.capital" {
1734-
classifier "$t.name"
1768+
archiveClassifier.set("$t.name")
17351769
}
17361770
}
17371771

@@ -2159,6 +2193,11 @@ project(":base") {
21592193
project.ext.moduleRuntime = true
21602194
project.ext.moduleName = "javafx.base"
21612195

2196+
// TODO: the following is an example of enabling module-specific lint opts
2197+
// project.ext.extraLintOptions =
2198+
// "deprecation" + "," +
2199+
// "divzero"
2200+
21622201
sourceSets {
21632202
main
21642203
shims {
@@ -2228,6 +2267,10 @@ project(":graphics") {
22282267
project.ext.moduleRuntime = true
22292268
project.ext.moduleName = "javafx.graphics"
22302269

2270+
// FIXME: Remove this setting when JDK-8334137 is fixed
2271+
// Disable javac -Werror until we stop using sun.misc.Unsafe
2272+
project.ext.disableJavacWerror = true
2273+
22312274
getConfigurations().create("antlr");
22322275

22332276
sourceSets {
@@ -2760,6 +2803,11 @@ project(":swing") {
27602803
// "-source NN -target NN" for this module.
27612804
project.ext.skipJavaCompilerOptionRelease = true
27622805

2806+
// We also need to disable the implicitly-enabled lint warning that
2807+
// results from the above
2808+
project.ext.extraLintOptions =
2809+
"-options"
2810+
27632811
tasks.all {
27642812
if (!COMPILE_SWING) it.enabled = false
27652813
}
@@ -4043,6 +4091,20 @@ project(":systemTests") {
40434091
addValidateSourceSets(project, nonModSrcSets, modSrcSets)
40444092
}
40454093

4094+
void setupLintOptions(Task compile, String lintOpts, String extraLintOpts) {
4095+
lintOpts.split("[, ]").each { s ->
4096+
compile.options.compilerArgs += "-Xlint:$s"
4097+
}
4098+
4099+
if (extraLintOpts != "") {
4100+
extraLintOpts.split("[, ]").each { s ->
4101+
compile.options.compilerArgs += "-Xlint:$s"
4102+
}
4103+
}
4104+
4105+
compile.options.compilerArgs += [ "-Xmaxwarns", "1000" ]
4106+
}
4107+
40464108
allprojects {
40474109
// The following block is a workaround for the fact that presently Gradle
40484110
// can't set the -XDignore.symbol.file flag, because it appears that the
@@ -4071,18 +4133,64 @@ allprojects {
40714133

40724134
compile.options.forkOptions.executable = JAVAC
40734135

4074-
compile.options.warnings = IS_LINT
4075-
40764136
compile.options.compilerArgs += ["-XDignore.symbol.file", "-encoding", "UTF-8"]
4137+
compile.options.compilerArgs += [ "-Xmaxerrs", "1000" ]
40774138

40784139
// we use a custom javadoc command
40794140
project.javadoc.enabled = false
40804141

4081-
// Add in the -Xlint options
4082-
if (IS_LINT) {
4083-
LINT.split("[, ]").each { s ->
4084-
compile.options.compilerArgs += "-Xlint:$s"
4142+
def disableJavacWerror =
4143+
project.hasProperty('disableJavacWerror') &&
4144+
project.ext.disableJavacWerror
4145+
4146+
if (compile.name == "compileJava" ||
4147+
compile.name == "compileFullJava" ||
4148+
compile.name.startsWith("compileJavaDOMBinding")) {
4149+
4150+
// Add in the -Xlint options
4151+
compile.options.warnings = IS_LINT
4152+
if (IS_LINT) {
4153+
def extraLintOpts = project.hasProperty("extraLintOptions") ?
4154+
project.ext.extraLintOptions : ""
4155+
setupLintOptions(compile, LINT, extraLintOpts);
4156+
4157+
if (IS_JAVAC_WERROR && !disableJavacWerror) {
4158+
compile.options.compilerArgs += "-Werror"
4159+
}
4160+
}
4161+
} else if (compile.name == "compileJslcJava" ||
4162+
compile.name == "compileDecoraCompilers" ||
4163+
compile.name == "compilePrismCompilers" ||
4164+
compile.name == "compileToolsJava") {
4165+
4166+
// Add in the -Xlint options
4167+
compile.options.warnings = IS_TOOL_LINT
4168+
if (IS_TOOL_LINT) {
4169+
def extraLintOpts = project.hasProperty("extraToolLintOptions") ?
4170+
project.ext.extraToolLintOptions : ""
4171+
setupLintOptions(compile, TOOL_LINT, extraLintOpts);
4172+
4173+
if (IS_TOOL_JAVAC_WERROR && !disableJavacWerror) {
4174+
compile.options.compilerArgs += "-Werror"
4175+
}
40854176
}
4177+
} else if (compile.name == "compileShimsJava" ||
4178+
compile.name.startsWith("compileTest")) {
4179+
4180+
// Add in the -Xlint options
4181+
compile.options.warnings = IS_TEST_LINT
4182+
if (IS_TEST_LINT) {
4183+
def extraLintOpts = project.hasProperty("extraTestLintOptions") ?
4184+
project.ext.extraTestLintOptions : ""
4185+
setupLintOptions(compile, TEST_LINT, extraLintOpts);
4186+
4187+
if (IS_TEST_JAVAC_WERROR && !disableJavacWerror) {
4188+
compile.options.compilerArgs += "-Werror"
4189+
}
4190+
}
4191+
} else {
4192+
logger.info("Unknown compilation task: ${project}:${compile.name}")
4193+
compile.options.warnings = false
40864194
}
40874195
} // tasks with javaCompile
40884196

modules/javafx.base/src/main/java/javafx/util/converter/CurrencyStringConverter.java

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public CurrencyStringConverter(NumberFormat numberFormat) {
9393
* @deprecated This method was exposed erroneously and will be removed in a future version.
9494
*/
9595
@Deprecated(forRemoval = true, since = "22")
96+
@SuppressWarnings("removal")
9697
@Override
9798
protected NumberFormat getNumberFormat() {
9899
Locale _locale = locale == null ? Locale.getDefault() : locale;

modules/javafx.base/src/main/java/javafx/util/converter/PercentageStringConverter.java

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public PercentageStringConverter(NumberFormat numberFormat) {
6969
* @deprecated This method was exposed erroneously and will be removed in a future version.
7070
*/
7171
@Deprecated(forRemoval = true, since = "22")
72+
@SuppressWarnings("removal")
7273
@Override
7374
public NumberFormat getNumberFormat() {
7475
Locale _locale = locale == null ? Locale.getDefault() : locale;

modules/javafx.controls/src/main/java/javafx/scene/chart/AreaChart.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public class AreaChart<X,Y> extends XYChart<X,Y> {
106106

107107
@Override
108108
public Object getBean() {
109-
return this;
109+
return AreaChart.this;
110110
}
111111

112112
@Override

modules/javafx.controls/src/main/java/javafx/scene/chart/Axis.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,6 @@ protected void tickMarksUpdated(){}
698698
}
699699
}
700700

701-
// call tick marks updated to inform subclasses that we have updated tick marks
702-
tickMarksUpdated();
703701
// mark all done
704702
oldLength = length;
705703
rangeValid = true;
@@ -750,6 +748,9 @@ protected void tickMarksUpdated(){}
750748
}
751749
}
752750
updateTickMarks(side, length);
751+
752+
// call tick marks updated to inform subclasses that we have updated tick marks
753+
tickMarksUpdated();
753754
}
754755
}
755756

0 commit comments

Comments
 (0)