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 + *