From 7490af8f4bc195e9db7b569ccd46a3794115de21 Mon Sep 17 00:00:00 2001 From: wuyafang <791828096@qq.com> Date: Mon, 14 Oct 2024 16:06:08 +0800 Subject: [PATCH] sync bishengjdk17 patch --- ...icFramework-CmdLine-is_executable-co.patch | 22 ++++++++++ ...epeated-the-in-StyleSheet.create-Sma.patch | 40 +++++++++++++++++++ 8337982-Remove-dead-undef-assrt0n.patch | 21 ++++++++++ ....awt.datatransfer.SystemFlavorMap-FL.patch | 22 ++++++++++ ...-8330191-Fix-typo-in-precompiled.hpp.patch | 29 ++++++++++++++ ...088-ubsan-shenandoahAdaptiveHeuristi.patch | 22 ++++++++++ ...712-Wrong-javadoc-in-java.util.Date-.patch | 29 ++++++++++++++ ...351-Remove-duplicate-line-in-FileMap.patch | 21 ++++++++++ Backport-of-JDK-8305680.patch | 30 ++++++++++++++ Backport-of-JDK-8305937.patch | 23 +++++++++++ openjdk-17.spec | 36 +++++++++++++++-- 11 files changed, 292 insertions(+), 3 deletions(-) create mode 100644 8335610-DiagnosticFramework-CmdLine-is_executable-co.patch create mode 100644 8337274-Remove-repeated-the-in-StyleSheet.create-Sma.patch create mode 100644 8337982-Remove-dead-undef-assrt0n.patch create mode 100644 8338785-The-java.awt.datatransfer.SystemFlavorMap-FL.patch create mode 100644 Backport-of-8330191-Fix-typo-in-precompiled.hpp.patch create mode 100644 Backport-of-8333088-ubsan-shenandoahAdaptiveHeuristi.patch create mode 100644 Backport-of-8337712-Wrong-javadoc-in-java.util.Date-.patch create mode 100644 Backport-of-8339351-Remove-duplicate-line-in-FileMap.patch create mode 100644 Backport-of-JDK-8305680.patch create mode 100644 Backport-of-JDK-8305937.patch diff --git a/8335610-DiagnosticFramework-CmdLine-is_executable-co.patch b/8335610-DiagnosticFramework-CmdLine-is_executable-co.patch new file mode 100644 index 0000000..2390ef8 --- /dev/null +++ b/8335610-DiagnosticFramework-CmdLine-is_executable-co.patch @@ -0,0 +1,22 @@ +Subject: 8335610: DiagnosticFramework: CmdLine::is_executable() correction + +--- + src/hotspot/share/services/diagnosticFramework.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/hotspot/share/services/diagnosticFramework.hpp b/src/hotspot/share/services/diagnosticFramework.hpp +index e182e5440..166384193 100644 +--- a/src/hotspot/share/services/diagnosticFramework.hpp ++++ b/src/hotspot/share/services/diagnosticFramework.hpp +@@ -67,7 +67,7 @@ public: + const char* cmd_addr() const { return _cmd; } + size_t cmd_len() const { return _cmd_len; } + bool is_empty() const { return _cmd_len == 0; } +- bool is_executable() const { return is_empty() || _cmd[0] != '#'; } ++ bool is_executable() const { return !is_empty() && _cmd[0] != '#'; } + bool is_stop() const { return !is_empty() && strncmp("stop", _cmd, _cmd_len) == 0; } + }; + +-- +2.33.0 + diff --git a/8337274-Remove-repeated-the-in-StyleSheet.create-Sma.patch b/8337274-Remove-repeated-the-in-StyleSheet.create-Sma.patch new file mode 100644 index 0000000..c829490 --- /dev/null +++ b/8337274-Remove-repeated-the-in-StyleSheet.create-Sma.patch @@ -0,0 +1,40 @@ +Subject: 8337274: Remove repeated 'the' in StyleSheet.create{Small,Large}AttributeSet + +--- + .../share/classes/javax/swing/text/html/StyleSheet.java | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java b/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java +index 958b3a899..25490291a 100644 +--- a/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java ++++ b/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java +@@ -691,7 +691,7 @@ public class StyleSheet extends StyleContext { + * to return an AttributeSet that provides some sort of + * attribute conversion. + * +- * @param a The set of attributes to be represented in the ++ * @param a The set of attributes to be represented in + * the compact form. + */ + protected SmallAttributeSet createSmallAttributeSet(AttributeSet a) { +@@ -707,7 +707,7 @@ public class StyleSheet extends StyleContext { + * to return a MutableAttributeSet that provides some sort of + * attribute conversion. + * +- * @param a The set of attributes to be represented in the ++ * @param a The set of attributes to be represented in + * the larger form. + */ + protected MutableAttributeSet createLargeAttributeSet(AttributeSet a) { +@@ -2140,7 +2140,7 @@ public class StyleSheet extends StyleContext { + /** + * Returns a string that represents the value + * of the HTML.Attribute.TYPE attribute. +- * If this attributes is not defined, then ++ * If this attributes is not defined, + * then the type defaults to "disc" unless + * the tag is on Ordered list. In the case + * of the latter, the default type is "decimal". +-- +2.33.0 + diff --git a/8337982-Remove-dead-undef-assrt0n.patch b/8337982-Remove-dead-undef-assrt0n.patch new file mode 100644 index 0000000..760d1f0 --- /dev/null +++ b/8337982-Remove-dead-undef-assrt0n.patch @@ -0,0 +1,21 @@ +Subject: 8337982: Remove dead undef assrt0n + +--- + src/hotspot/share/memory/metaspace/blockTree.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/hotspot/share/memory/metaspace/blockTree.cpp b/src/hotspot/share/memory/metaspace/blockTree.cpp +index ed2964534..9c78eef84 100644 +--- a/src/hotspot/share/memory/metaspace/blockTree.cpp ++++ b/src/hotspot/share/memory/metaspace/blockTree.cpp +@@ -180,7 +180,6 @@ void BlockTree::verify() const { + // as many nodes as are in this tree) + _counter.check(counter); + +- #undef assrt0n + } + + void BlockTree::zap_range(MetaWord* p, size_t word_size) { +-- +2.33.0 + diff --git a/8338785-The-java.awt.datatransfer.SystemFlavorMap-FL.patch b/8338785-The-java.awt.datatransfer.SystemFlavorMap-FL.patch new file mode 100644 index 0000000..13fba95 --- /dev/null +++ b/8338785-The-java.awt.datatransfer.SystemFlavorMap-FL.patch @@ -0,0 +1,22 @@ +Subject: 8338785: The java.awt.datatransfer.SystemFlavorMap#FLAVOR_MAP_KEY field is not used + +--- + .../share/classes/java/awt/datatransfer/SystemFlavorMap.java | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/java.datatransfer/share/classes/java/awt/datatransfer/SystemFlavorMap.java b/src/java.datatransfer/share/classes/java/awt/datatransfer/SystemFlavorMap.java +index d48146513..4bde236fc 100644 +--- a/src/java.datatransfer/share/classes/java/awt/datatransfer/SystemFlavorMap.java ++++ b/src/java.datatransfer/share/classes/java/awt/datatransfer/SystemFlavorMap.java +@@ -61,8 +61,6 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { + */ + private static String JavaMIME = "JAVA_DATAFLAVOR:"; + +- private static final Object FLAVOR_MAP_KEY = new Object(); +- + /** + * The list of valid, decoded text flavor representation classes, in order + * from best to worst. +-- +2.33.0 + diff --git a/Backport-of-8330191-Fix-typo-in-precompiled.hpp.patch b/Backport-of-8330191-Fix-typo-in-precompiled.hpp.patch new file mode 100644 index 0000000..45357ad --- /dev/null +++ b/Backport-of-8330191-Fix-typo-in-precompiled.hpp.patch @@ -0,0 +1,29 @@ +Subject: Backport of 8330191: Fix typo in precompiled.hpp + +--- + src/hotspot/share/precompiled/precompiled.hpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/hotspot/share/precompiled/precompiled.hpp b/src/hotspot/share/precompiled/precompiled.hpp +index d34304741..54d03ed71 100644 +--- a/src/hotspot/share/precompiled/precompiled.hpp ++++ b/src/hotspot/share/precompiled/precompiled.hpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2010, 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 +@@ -29,7 +29,7 @@ + + // These header files are included in at least 130 C++ files, as of + // measurements made in November 2018. This list excludes files named +-// *.include.hpp, since including them decreased build performance. ++// *.inline.hpp, since including them decreased build performance. + + #include "classfile/classLoaderData.hpp" + #include "classfile/javaClasses.hpp" +-- +2.33.0 + diff --git a/Backport-of-8333088-ubsan-shenandoahAdaptiveHeuristi.patch b/Backport-of-8333088-ubsan-shenandoahAdaptiveHeuristi.patch new file mode 100644 index 0000000..6ed37f3 --- /dev/null +++ b/Backport-of-8333088-ubsan-shenandoahAdaptiveHeuristi.patch @@ -0,0 +1,22 @@ +Subject: Backport of 8333088: ubsan: shenandoahAdaptiveHeuristics.cpp: runtime error: division by zero + +--- + .../gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp +index 819f1e8d7..371e4c90c 100644 +--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp ++++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp +@@ -243,7 +243,7 @@ bool ShenandoahAdaptiveHeuristics::should_start_gc() { + + double avg_cycle_time = _gc_time_history->davg() + (_margin_of_error_sd * _gc_time_history->dsd()); + double avg_alloc_rate = _allocation_rate.upper_bound(_margin_of_error_sd); +- if (avg_cycle_time > allocation_headroom / avg_alloc_rate) { ++ if (avg_cycle_time * avg_alloc_rate > allocation_headroom) { + log_info(gc)("Trigger: Average GC time (%.2f ms) is above the time for average allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s) (margin of error = %.2f)", + avg_cycle_time * 1000, + byte_size_in_proper_unit(avg_alloc_rate), proper_unit_for_byte_size(avg_alloc_rate), +-- +2.33.0 + diff --git a/Backport-of-8337712-Wrong-javadoc-in-java.util.Date-.patch b/Backport-of-8337712-Wrong-javadoc-in-java.util.Date-.patch new file mode 100644 index 0000000..a4c36c1 --- /dev/null +++ b/Backport-of-8337712-Wrong-javadoc-in-java.util.Date-.patch @@ -0,0 +1,29 @@ +Subject: Backport of 8337712: Wrong javadoc in java.util.Date#toString(): 61 and right parenthesis + +--- + src/java.base/share/classes/java/util/Date.java | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/java.base/share/classes/java/util/Date.java b/src/java.base/share/classes/java/util/Date.java +index d0b31a402..9a0552dd3 100644 +--- a/src/java.base/share/classes/java/util/Date.java ++++ b/src/java.base/share/classes/java/util/Date.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1994, 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 +@@ -1014,7 +1014,7 @@ public class Date + *
  • {@code mm} is the minute within the hour ({@code 00} through + * {@code 59}), as two decimal digits. + *
  • {@code ss} is the second within the minute ({@code 00} through +- * {@code 61}, as two decimal digits. ++ * {@code 61}), as two decimal digits. + *
  • {@code zzz} is the time zone (and may reflect daylight saving + * time). Standard time zone abbreviations include those + * recognized by the method {@code parse}. If time zone +-- +2.33.0 + diff --git a/Backport-of-8339351-Remove-duplicate-line-in-FileMap.patch b/Backport-of-8339351-Remove-duplicate-line-in-FileMap.patch new file mode 100644 index 0000000..7f76a14 --- /dev/null +++ b/Backport-of-8339351-Remove-duplicate-line-in-FileMap.patch @@ -0,0 +1,21 @@ +Subject: Backport of 8339351: Remove duplicate line in FileMapHeader::print + +--- + src/hotspot/share/cds/filemap.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp +index fa981d38c..106c14bfc 100644 +--- a/src/hotspot/share/cds/filemap.cpp ++++ b/src/hotspot/share/cds/filemap.cpp +@@ -287,7 +287,6 @@ void FileMapHeader::print(outputStream* st) { + st->print_cr("- core_region_alignment: " SIZE_FORMAT, _core_region_alignment); + st->print_cr("- obj_alignment: %d", _obj_alignment); + st->print_cr("- narrow_oop_base: " INTPTR_FORMAT, p2i(_narrow_oop_base)); +- st->print_cr("- narrow_oop_base: " INTPTR_FORMAT, p2i(_narrow_oop_base)); + st->print_cr("- narrow_oop_shift %d", _narrow_oop_shift); + st->print_cr("- compact_strings: %d", _compact_strings); + st->print_cr("- max_heap_size: " UINTX_FORMAT, _max_heap_size); +-- +2.33.0 + diff --git a/Backport-of-JDK-8305680.patch b/Backport-of-JDK-8305680.patch new file mode 100644 index 0000000..e21eb9a --- /dev/null +++ b/Backport-of-JDK-8305680.patch @@ -0,0 +1,30 @@ +Subject: Backport of JDK-8305680 + +--- + src/hotspot/share/services/diagnosticCommand.cpp | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/src/hotspot/share/services/diagnosticCommand.cpp b/src/hotspot/share/services/diagnosticCommand.cpp +index 51f47421c..1400e4a3f 100644 +--- a/src/hotspot/share/services/diagnosticCommand.cpp ++++ b/src/hotspot/share/services/diagnosticCommand.cpp +@@ -191,16 +191,6 @@ void HelpDCmd::execute(DCmdSource source, TRAPS) { + factory->is_enabled() ? "" : " [disabled]"); + output()->print_cr("%s", factory->description()); + output()->print_cr("\nImpact: %s", factory->impact()); +- JavaPermission p = factory->permission(); +- if(p._class != NULL) { +- if(p._action != NULL) { +- output()->print_cr("\nPermission: %s(%s, %s)", +- p._class, p._name == NULL ? "null" : p._name, p._action); +- } else { +- output()->print_cr("\nPermission: %s(%s)", +- p._class, p._name == NULL ? "null" : p._name); +- } +- } + output()->cr(); + cmd = factory->create_resource_instance(output()); + if (cmd != NULL) { +-- +2.33.0 + diff --git a/Backport-of-JDK-8305937.patch b/Backport-of-JDK-8305937.patch new file mode 100644 index 0000000..e4532dc --- /dev/null +++ b/Backport-of-JDK-8305937.patch @@ -0,0 +1,23 @@ +Subject: Backport of JDK-8305937 + +Signed-off-by: Qeryu +--- + test/jdk/com/sun/jdi/TestScaffold.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/jdk/com/sun/jdi/TestScaffold.java b/test/jdk/com/sun/jdi/TestScaffold.java +index 2d4885c90..e46a44eda 100644 +--- a/test/jdk/com/sun/jdi/TestScaffold.java ++++ b/test/jdk/com/sun/jdi/TestScaffold.java +@@ -513,7 +513,7 @@ abstract public class TestScaffold extends TargetAdapter { + public void connect(String args[]) { + ArgInfo argInfo = parseArgs(args); + +- argInfo.targetVMArgs += VMConnection.getDebuggeeVMOptions(); ++ argInfo.targetVMArgs = VMConnection.getDebuggeeVMOptions() + " " + argInfo.targetVMArgs; + connection = new VMConnection(argInfo.connectorSpec, + argInfo.traceFlags); + +-- +2.33.0 + diff --git a/openjdk-17.spec b/openjdk-17.spec index a891d29..8d50eb2 100644 --- a/openjdk-17.spec +++ b/openjdk-17.spec @@ -903,7 +903,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release} Name: java-%{javaver}-%{origin} Version: %{newjavaver}.%{buildver} -Release: 4 +Release: 5 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages @@ -1026,7 +1026,16 @@ Patch53: Add-JBooster-options-check.patch Patch54: KAE-zip-Features.patch Patch55: heap-dump-redact-support.patch Patch56: Backport-Important-Fixed-Issues.patch - +Patch57: Backport-of-JDK-8305680.patch +Patch58: Backport-of-JDK-8305937.patch +Patch59: 8338785-The-java.awt.datatransfer.SystemFlavorMap-FL.patch +Patch60: 8337982-Remove-dead-undef-assrt0n.patch +Patch61: 8337274-Remove-repeated-the-in-StyleSheet.create-Sma.patch +Patch62: 8335610-DiagnosticFramework-CmdLine-is_executable-co.patch +Patch63: Backport-of-8333088-ubsan-shenandoahAdaptiveHeuristi.patch +Patch64: Backport-of-8339351-Remove-duplicate-line-in-FileMap.patch +Patch65: Backport-of-8330191-Fix-typo-in-precompiled.hpp.patch +Patch66: Backport-of-8337712-Wrong-javadoc-in-java.util.Date-.patch ############################################ # # LoongArch64 specific patches @@ -1298,7 +1307,16 @@ pushd %{top_level_dir_name} %patch55 -p1 %patch56 -p1 %endif - +%patch57 -p1 +%patch58 -p1 +%patch59 -p1 +%patch60 -p1 +%patch61 -p1 +%patch62 -p1 +%patch63 -p1 +%patch64 -p1 +%patch65 -p1 +%patch66 -p1 popd # openjdk %endif @@ -1865,6 +1883,18 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect %changelog +* Mon Oct 14 2024 Autistic_boyya - 1:17.0.12.7-5 +- Add Backport-of-JDK-8305680.patch +- Add Backport-of-JDK-8305937.patch +- Add 8338785-The-java.awt.datatransfer.SystemFlavorMap-FL.patch +- Add 8337982-Remove-dead-undef-assrt0n.patch +- Add 8337274-Remove-repeated-the-in-StyleSheet.create-Sma.patch +- Add 8335610-DiagnosticFramework-CmdLine-is_executable-co.patch +- Add Backport-of-8333088-ubsan-shenandoahAdaptiveHeuristi.patch +- Add Backport-of-8339351-Remove-duplicate-line-in-FileMap.patch +- Add Backport-of-8330191-Fix-typo-in-precompiled.hpp.patch +- Add Backport-of-8337712-Wrong-javadoc-in-java.util.Date-.patch + * Mon Sep 23 2024 Dingli Zhang - 1:17.0.12.7-4 - Remove the KAE patch for riscv64 to fix build errors -- Gitee