Skip to content

Commit

Permalink
Merge tag 'jdk-25+3' into labsjdk/adopt-jdk-25+3-master
Browse files Browse the repository at this point in the history
Added tag jdk-25+3 for changeset 23d6f74
  • Loading branch information
OracleLabsAutomation committed Dec 19, 2024
2 parents c040448 + 23d6f74 commit 7a9c10b
Show file tree
Hide file tree
Showing 942 changed files with 11,924 additions and 4,668 deletions.
7 changes: 6 additions & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jbs=JDK
version=25

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists,copyright
warning=issuestitle,binary

[repository]
Expand Down Expand Up @@ -34,3 +34,8 @@ pattern=^([124-8][0-9]{6}): (\S.*)$

[checks "problemlists"]
dirs=test/jdk|test/langtools|test/lib-test|test/hotspot/jtreg|test/jaxp

[checks "copyright"]
files=^(?!LICENSE|license\.txt|.*\.bin|.*\.gif|.*\.jpg|.*\.png|.*\.icon|.*\.tiff|.*\.dat|.*\.patch|.*\.wav|.*\.class|.*-header|.*\.jar|).*
oracle_locator=.*Copyright \(c\)(.*)Oracle and/or its affiliates\. All rights reserved\.
oracle_validator=.*Copyright \(c\) (\d{4})(?:, (\d{4}))?, Oracle and/or its affiliates\. All rights reserved\.
5 changes: 4 additions & 1 deletion make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,10 @@ endif
################################################################################

# all-images builds all our deliverables as images.
all-images: product-images static-jdk-image test-image all-docs-images
all-images: product-images test-image all-docs-images
ifeq ($(call isTargetOs, linux macosx windows), true)
all-images: static-jdk-image
endif

# all-bundles packages all our deliverables as tar.gz bundles.
all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles
Expand Down
23 changes: 4 additions & 19 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
# Additional warnings that are not activated by -Wall and -Wextra
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wreturn-type -Wsign-compare \
-Wtrampolines -Wundef -Wunused-const-variable=1 -Wunused-function \
-Wunused-result -Wunused-value"
-Wunused-result -Wunused-value -Wtype-limits -Wuninitialized"
WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
Expand Down Expand Up @@ -754,10 +754,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then
FLAGS_SETUP_GCC6_COMPILER_FLAGS($1, $3)
$1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
$1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
# This flag is required since GCC 6 as undefined behavior in OpenJDK code
# runs afoul of the more aggressive versions of this optimization.
$1_TOOLCHAIN_CFLAGS="-fno-lifetime-dse"
fi
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
Expand Down Expand Up @@ -919,20 +918,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
AC_SUBST($2SVE_CFLAGS)
])

# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
# Arguments:
# $1 - Prefix for each variable defined.
# $2 - Prefix for compiler variables (either BUILD_ or nothing).
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
[
# This flag is required for GCC 6 builds as undefined behavior in OpenJDK code
# runs afoul of the more aggressive versions of this optimization.
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG],
PREFIX: $2, IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
$1_GCC6_CFLAGS="${NO_LIFETIME_DSE_CFLAG}"
])

AC_DEFUN_ONCE([FLAGS_SETUP_BRANCH_PROTECTION],
[
# Is branch protection available?
Expand Down
2 changes: 1 addition & 1 deletion make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ var getJibProfilesProfiles = function (input, common, data) {
target_os: input.build_os,
target_cpu: input.build_cpu,
dependencies: [
"boot_jdk", "devkit", "graphviz", "pandoc", buildJdkDep,
"autoconf", "boot_jdk", "devkit", "graphviz", "pandoc", buildJdkDep,
],
configure_args: concat(
"--enable-full-docs",
Expand Down
2 changes: 1 addition & 1 deletion make/hotspot/lib/CompileJvm.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ CFLAGS_VM_VERSION := \
# Disabled warnings

DISABLED_WARNINGS_gcc := array-bounds comment delete-non-virtual-dtor \
empty-body implicit-fallthrough int-in-bool-context \
empty-body format-zero-length implicit-fallthrough int-in-bool-context \
maybe-uninitialized missing-field-initializers \
shift-negative-value unknown-pragmas unused-but-set-variable \
unused-local-typedefs unused-variable
Expand Down
4 changes: 2 additions & 2 deletions make/jdk/src/classes/build/tools/depend/Depend.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 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
Expand Down Expand Up @@ -446,7 +446,7 @@ public Void visitType(TypeElement e, Void p) {
}

@Override
public Void visitRecordComponent(@SuppressWarnings("preview")RecordComponentElement e, Void p) {
public Void visitRecordComponent(RecordComponentElement e, Void p) {
update(e.getSimpleName());
visit(e.asType());
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ public class CreateSymbols {
/**Create sig files for ct.sym reading the classes description from the directory that contains
* {@code ctDescriptionFile}, using the file as a recipe to create the sigfiles.
*/
@SuppressWarnings("unchecked")
public void createSymbols(String ctDescriptionFileExtra, String ctDescriptionFile, String ctSymLocation,
long timestamp, String currentVersion, String preReleaseTag, String moduleClasses,
String includedModulesFile) throws IOException {
Expand Down Expand Up @@ -4634,7 +4633,6 @@ private static AnnotationDescription parseAnnotation(String value, int[] valuePo
/**Create sig files for ct.sym reading the classes description from the directory that contains
* {@code ctDescriptionFile}, using the file as a recipe to create the sigfiles.
*/
@SuppressWarnings("unchecked")
public void createJavadocData(String ctDescriptionFileExtra, String ctDescriptionFile,
String targetDir, int startVersion) throws IOException {
LoadDescriptions data = load(ctDescriptionFileExtra != null ? Paths.get(ctDescriptionFileExtra)
Expand Down
71 changes: 55 additions & 16 deletions make/langtools/tools/propertiesparser/gen/ClassGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
Expand Down Expand Up @@ -87,9 +88,12 @@ enum StubKind {
FACTORY_METHOD_DECL("factory.decl.method"),
FACTORY_METHOD_ARG("factory.decl.method.arg"),
FACTORY_METHOD_BODY("factory.decl.method.body"),
FACTORY_METHOD_BODY_LINT("factory.decl.method.body.lint"),
FACTORY_FIELD("factory.decl.field"),
FACTORY_FIELD_LINT("factory.decl.field.lint"),
WILDCARDS_EXTENDS("wildcards.extends"),
SUPPRESS_WARNINGS("suppress.warnings");
SUPPRESS_WARNINGS("suppress.warnings"),
LINT_CATEGORY("lint.category");

/** stub key (as it appears in the property file) */
String key;
Expand All @@ -114,6 +118,7 @@ String format(Object... args) {
enum FactoryKind {
ERR("err", "Error", "Errors"),
WARN("warn", "Warning", "Warnings"),
LINT_WARN("warn", "LintWarning", "LintWarnings"),
NOTE("note", "Note", "Notes"),
MISC("misc", "Fragment", "Fragments"),
OTHER(null, null, null);
Expand All @@ -136,13 +141,24 @@ enum FactoryKind {
/**
* Utility method for parsing a factory kind from a resource key prefix.
*/
static FactoryKind parseFrom(String prefix) {
static FactoryKind of(Entry<String, Message> messageEntry) {
String prefix = messageEntry.getKey().split("\\.")[1];
FactoryKind selected = null;
for (FactoryKind k : FactoryKind.values()) {
if (k.prefix == null || k.prefix.equals(prefix)) {
return k;
selected = k;
break;
}
}
return null;
if (selected == WARN) {
for (MessageLine line : messageEntry.getValue().getLines(false)) {
if (line.isLint()) {
selected = LINT_WARN;
break;
}
}
}
return selected;
}
}

Expand All @@ -155,7 +171,7 @@ public void generateFactory(MessageFile messageFile, File outDir) {
messageFile.messages.entrySet().stream()
.collect(
Collectors.groupingBy(
e -> FactoryKind.parseFrom(e.getKey().split("\\.")[1]),
FactoryKind::of,
TreeMap::new,
toList()));
//generate nested classes
Expand All @@ -165,7 +181,7 @@ public void generateFactory(MessageFile messageFile, File outDir) {
if (entry.getKey() == FactoryKind.OTHER) continue;
//emit members
String members = entry.getValue().stream()
.flatMap(e -> generateFactoryMethodsAndFields(e.getKey(), e.getValue()).stream())
.flatMap(e -> generateFactoryMethodsAndFields(entry.getKey(), e.getKey(), e.getValue()).stream())
.collect(Collectors.joining("\n\n"));
//emit nested class
String factoryDecl =
Expand Down Expand Up @@ -230,22 +246,35 @@ List<String> generateImports(Set<String> importedTypes) {
/**
* Generate a list of factory methods/fields to be added to a given factory nested class.
*/
List<String> generateFactoryMethodsAndFields(String key, Message msg) {
List<String> generateFactoryMethodsAndFields(FactoryKind k, String key, Message msg) {
MessageInfo msgInfo = msg.getMessageInfo();
List<MessageLine> lines = msg.getLines(false);
String javadoc = lines.stream()
.filter(ml -> !ml.isInfo() && !ml.isEmptyOrComment())
.map(ml -> ml.text)
.collect(Collectors.joining("\n *"));
String[] keyParts = key.split("\\.");
FactoryKind k = FactoryKind.parseFrom(keyParts[1]);
String lintCategory = lines.stream()
.filter(MessageLine::isLint)
.map(MessageLine::lintCategory)
.findFirst().orElse(null);
//System.out.println("category for " + key + " = " + lintCategory);
String factoryName = factoryName(key);
if (msgInfo.getTypes().isEmpty()) {
//generate field
String factoryField = StubKind.FACTORY_FIELD.format(k.keyClazz, factoryName,
"\"" + keyParts[0] + "\"",
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
javadoc);
String factoryField;
if (lintCategory == null) {
factoryField = StubKind.FACTORY_FIELD.format(k.keyClazz, factoryName,
"\"" + keyParts[0] + "\"",
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
javadoc);
} else {
factoryField = StubKind.FACTORY_FIELD_LINT.format(k.keyClazz, factoryName,
StubKind.LINT_CATEGORY.format("\"" + lintCategory + "\""),
"\"" + keyParts[0] + "\"",
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
javadoc);
}
return Collections.singletonList(factoryField);
} else {
//generate method
Expand All @@ -255,12 +284,22 @@ List<String> generateFactoryMethodsAndFields(String key, Message msg) {
List<String> argNames = argNames(types.size());
String suppressionString = needsSuppressWarnings(msgTypes) ?
StubKind.SUPPRESS_WARNINGS.format() : "";
String methodBody;
if (lintCategory == null) {
methodBody = StubKind.FACTORY_METHOD_BODY.format(k.keyClazz,
"\"" + keyParts[0] + "\"",
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
argNames.stream().collect(Collectors.joining(", ")));
} else {
methodBody = StubKind.FACTORY_METHOD_BODY_LINT.format(k.keyClazz,
StubKind.LINT_CATEGORY.format("\"" + lintCategory + "\""),
"\"" + keyParts[0] + "\"",
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
argNames.stream().collect(Collectors.joining(", ")));
}
String factoryMethod = StubKind.FACTORY_METHOD_DECL.format(suppressionString, k.keyClazz,
factoryName, argDecls(types, argNames).stream().collect(Collectors.joining(", ")),
indent(StubKind.FACTORY_METHOD_BODY.format(k.keyClazz,
"\"" + keyParts[0] + "\"",
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
argNames.stream().collect(Collectors.joining(", "))), 1),
indent(methodBody, 1),
javadoc);
factoryMethods.add(factoryMethod);
}
Expand Down
5 changes: 4 additions & 1 deletion make/langtools/tools/propertiesparser/parser/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public final class Message {
public MessageInfo getMessageInfo() {
if (messageInfo == null) {
MessageLine l = firstLine.prev;
if (l != null && l.isLint()) {
l = l.prev;
}
if (l != null && l.isInfo())
messageInfo = new MessageInfo(l.text);
else
Expand All @@ -71,7 +74,7 @@ public List<MessageLine> getLines(boolean includeAllPrecedingComments) {
while (l.text.isEmpty())
l = l.next;
} else {
if (l.prev != null && l.prev.isInfo())
if (l.prev != null && (l.prev.isInfo() || l.prev.isLint()))
l = l.prev;
}

Expand Down
15 changes: 15 additions & 0 deletions make/langtools/tools/propertiesparser/parser/MessageLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

package propertiesparser.parser;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
Expand All @@ -37,6 +38,7 @@ public class MessageLine {
static final Pattern typePattern = Pattern.compile("[-\\\\'A-Z\\.a-z ]+( \\([-A-Za-z 0-9]+\\))?");
static final Pattern infoPattern = Pattern.compile(String.format("# ([0-9]+: %s, )*[0-9]+: %s",
typePattern.pattern(), typePattern.pattern()));
static final Pattern lintPattern = Pattern.compile("# lint: ([a-z\\-]+)");

public String text;
MessageLine prev;
Expand All @@ -54,6 +56,19 @@ public boolean isInfo() {
return infoPattern.matcher(text).matches();
}

public boolean isLint() {
return lintPattern.matcher(text).matches();
}

public String lintCategory() {
Matcher matcher = lintPattern.matcher(text);
if (matcher.matches()) {
return matcher.group(1);
} else {
return null;
}
}

boolean hasContinuation() {
return (next != null) && text.endsWith("\\");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 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
Expand Down Expand Up @@ -29,8 +29,10 @@ toplevel.decl=\
{1}\n\
import com.sun.tools.javac.util.JCDiagnostic.Error;\n\
import com.sun.tools.javac.util.JCDiagnostic.Warning;\n\
import com.sun.tools.javac.util.JCDiagnostic.LintWarning;\n\
import com.sun.tools.javac.util.JCDiagnostic.Note;\n\
import com.sun.tools.javac.util.JCDiagnostic.Fragment;\n\
import com.sun.tools.javac.code.Lint.LintCategory;\n\
\n\
public class {2} '{'\n\
{3}\n\
Expand Down Expand Up @@ -58,16 +60,27 @@ factory.decl.method.arg=\
factory.decl.method.body=\
return new {0}({1}, {2}, {3});

factory.decl.method.body.lint=\
return new {0}({1}, {2}, {3}, {4});

factory.decl.field=\
/**\n\
' '* {4}\n\
' '*/\n\
public static final {0} {1} = new {0}({2}, {3});

factory.decl.field.lint=\
/**\n\
' '* {5}\n\
' '*/\n\
public static final {0} {1} = new {0}({2}, {3}, {4});

wildcards.extends=\
{0}<? extends {1}>

suppress.warnings=\
@SuppressWarnings("rawtypes")\n

lint.category=\
LintCategory.get({0}).get()

2 changes: 1 addition & 1 deletion make/modules/java.desktop/lib/ClientLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ ifeq ($(FREETYPE_TO_USE), bundled)
OPTIMIZATION := HIGHEST, \
CFLAGS := -DFT2_BUILD_LIBRARY, \
CFLAGS_windows := -DDLL_EXPORT, \
EXTRA_HEADER_DIRS := libfreetype/include, \
EXTRA_HEADER_DIRS := java.base:libjava libfreetype/include, \
DISABLED_WARNINGS_microsoft := 4267 4244 4996, \
DISABLED_WARNINGS_gcc := dangling-pointer stringop-overflow, \
))
Expand Down
4 changes: 3 additions & 1 deletion make/test/BuildMicrobenchmark.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ MICROBENCHMARK_JAR := $(MICROBENCHMARK_IMAGE_DIR)/benchmarks.jar

MICROBENCHMARK_OUTPUT := $(SUPPORT_OUTPUTDIR)/test/micro
MICROBENCHMARK_CLASSES := $(MICROBENCHMARK_OUTPUT)/classes
MICROBENCHMARK_GENSRC := $(MICROBENCHMARK_OUTPUT)/gensrc
MICROBENCHMARK_JAR_BIN := $(MICROBENCHMARK_OUTPUT)/jar

MICROBENCHMARK_TOOLS_CLASSES := $(MICROBENCHMARK_OUTPUT)/tools-classes
Expand Down Expand Up @@ -104,7 +105,8 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
--add-exports java.base/sun.security.util.math.intpoly=ALL-UNNAMED \
--enable-preview \
-XDsuppressNotes \
-processor org.openjdk.jmh.generators.BenchmarkProcessor, \
-processor org.openjdk.jmh.generators.BenchmarkProcessor \
-s $(MICROBENCHMARK_GENSRC), \
JAVA_FLAGS := \
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
--add-modules jdk.unsupported \
Expand Down
Loading

0 comments on commit 7a9c10b

Please sign in to comment.