From 560680559e3ec17e130322ada1ebd28267d00e7c Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Thu, 23 Jan 2025 01:39:20 +0000 Subject: [PATCH 01/24] 8348102: java/net/httpclient/HttpClientSNITest.java fails intermittently Reviewed-by: dfuchs, djelinski --- .../net/httpclient/HttpClientSNITest.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/jdk/java/net/httpclient/HttpClientSNITest.java b/test/jdk/java/net/httpclient/HttpClientSNITest.java index 1505a216593..095508fd849 100644 --- a/test/jdk/java/net/httpclient/HttpClientSNITest.java +++ b/test/jdk/java/net/httpclient/HttpClientSNITest.java @@ -46,7 +46,6 @@ import jdk.httpclient.test.lib.common.ServerNameMatcher; import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import static java.nio.charset.StandardCharsets.US_ASCII; @@ -70,8 +69,6 @@ public class HttpClientSNITest { private static final String RESP_BODY_TEXT = "hello world"; - private static SSLContext sslContext; - private static final class Handler implements HttpTestHandler { @Override @@ -85,12 +82,6 @@ public void handle(final HttpTestExchange exch) throws IOException { } } - @BeforeAll - static void beforeAll() throws Exception { - sslContext = new SimpleSSLContext().get(); - assertNotNull(sslContext, "could not create a SSLContext"); - } - /* * Creates and configures a HTTPS server with a SNIMatcher that * expects a specific SNI name to be sent by the connection client. @@ -104,9 +95,11 @@ static void beforeAll() throws Exception { @ParameterizedTest @ValueSource(booleans = {false, true}) void testRequestToIPLiteralHost(final boolean sniConfiguredOnClient) throws Exception { + final SSLContext sslContext = new SimpleSSLContext().get(); + assertNotNull(sslContext, "could not create a SSLContext"); final String expectedSNI = "non-dns-resolvable.foo.bar.localhost"; final ServerNameMatcher matcher = new ServerNameMatcher(expectedSNI); - final HttpTestServer server = createServer(matcher); + final HttpTestServer server = createServer(matcher, sslContext); try { final HttpClient.Builder builder = HttpClient.newBuilder().sslContext(sslContext); if (sniConfiguredOnClient) { @@ -156,10 +149,12 @@ void testRequestToIPLiteralHost(final boolean sniConfiguredOnClient) throws Exce @ParameterizedTest @ValueSource(booleans = {false, true}) void testRequestResolvedHostName(final boolean sniConfiguredOnClient) throws Exception { + final SSLContext sslContext = new SimpleSSLContext().get(); + assertNotNull(sslContext, "could not create a SSLContext"); final String resolvedHostName = InetAddress.getLoopbackAddress().getHostName(); final String expectedSNI = resolvedHostName; final ServerNameMatcher matcher = new ServerNameMatcher(expectedSNI); - final HttpTestServer server = createServer(matcher); + final HttpTestServer server = createServer(matcher, sslContext); try { final HttpClient.Builder builder = HttpClient.newBuilder().sslContext(sslContext); if (sniConfiguredOnClient) { @@ -190,7 +185,8 @@ void testRequestResolvedHostName(final boolean sniConfiguredOnClient) throws Exc /* * Creates a HttpsServer configured to use the given SNIMatcher */ - private static HttpTestServer createServer(final SNIMatcher matcher) throws Exception { + private static HttpTestServer createServer(final SNIMatcher matcher, + final SSLContext sslContext) throws Exception { final InetSocketAddress addr = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); final int backlog = 0; final HttpsServer httpsServer = HttpsServer.create(addr, backlog); From 7ec1a2c37660358cd029941b7c1da66347701ddf Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 23 Jan 2025 07:51:11 +0000 Subject: [PATCH 02/24] 8348324: The failure handler cannot be build by JDK 24 due to restricted warning Reviewed-by: jwaters, jpai --- .../failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java index fcf32ff42e7..82b0151d86c 100644 --- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, 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 @@ -36,6 +36,7 @@ * A timeout handler for jtreg, which gathers information about the timed out * process and its children. */ +@SuppressWarnings("restricted") public class GatherProcessInfoTimeoutHandler extends TimeoutHandler { private static final boolean HAS_NATIVE_LIBRARY; static { From 35f0fa8f824b94e6915ace1cda5bf14765a3ec14 Mon Sep 17 00:00:00 2001 From: Johny Jose Date: Thu, 23 Jan 2025 08:26:43 +0000 Subject: [PATCH 03/24] 8347965: (tz) Update Timezone Data to 2025a Reviewed-by: coffeys, naoto --- src/java.base/share/data/tzdata/VERSION | 2 +- src/java.base/share/data/tzdata/antarctica | 2 + src/java.base/share/data/tzdata/asia | 113 +++++++++++++----- src/java.base/share/data/tzdata/australasia | 113 ++++++++++-------- src/java.base/share/data/tzdata/etcetera | 4 + src/java.base/share/data/tzdata/europe | 2 +- src/java.base/share/data/tzdata/factory | 10 ++ src/java.base/share/data/tzdata/leapseconds | 8 +- src/java.base/share/data/tzdata/northamerica | 9 +- src/java.base/share/data/tzdata/southamerica | 27 ++++- .../java/util/TimeZone/TimeZoneData/VERSION | 2 +- .../util/TimeZone/TimeZoneData/aliases.txt | 3 - 12 files changed, 196 insertions(+), 99 deletions(-) diff --git a/src/java.base/share/data/tzdata/VERSION b/src/java.base/share/data/tzdata/VERSION index 740427424a6..9c056fac345 100644 --- a/src/java.base/share/data/tzdata/VERSION +++ b/src/java.base/share/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2024b +tzdata2025a diff --git a/src/java.base/share/data/tzdata/antarctica b/src/java.base/share/data/tzdata/antarctica index 058d8d6a7a2..87787d31cfe 100644 --- a/src/java.base/share/data/tzdata/antarctica +++ b/src/java.base/share/data/tzdata/antarctica @@ -197,6 +197,8 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13 # France & Italy - year-round base # Concordia, -750600+1232000, since 2005 +# https://en.wikipedia.org/wiki/Concordia_Station +# Can use Asia/Singapore, which it has agreed with since inception. # Germany - year-round base # Neumayer III, -704080-0081602, since 2009 diff --git a/src/java.base/share/data/tzdata/asia b/src/java.base/share/data/tzdata/asia index 5c8568f334a..b0a6fa01d20 100644 --- a/src/java.base/share/data/tzdata/asia +++ b/src/java.base/share/data/tzdata/asia @@ -3688,21 +3688,70 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # be immediately followed by 1845-01-01; see R.H. van Gent's # History of the International Date Line # https://webspace.science.uu.nl/~gent0113/idl/idl_philippines.htm -# The rest of the data entries are from Shanks & Pottenger. - -# From Jesper Nørgaard Welen (2006-04-26): -# ... claims that Philippines had DST last time in 1990: -# http://story.philippinetimes.com/p.x/ct/9/id/145be20cc6b121c0/cid/3e5bbccc730d258c/ -# [a story dated 2006-04-25 by Cris Larano of Dow Jones Newswires, -# but no details] - -# From Paul Eggert (2014-08-14): -# The following source says DST may be instituted November-January and again -# March-June, but this is not definite. It also says DST was last proclaimed -# during the Ramos administration (1992-1998); but again, no details. -# Carcamo D. PNoy urged to declare use of daylight saving time. -# Philippine Star 2014-08-05 -# http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time + +# From P Chan (2021-05-10): +# Here's a fairly comprehensive article in Japanese: +# https://wiki.suikawiki.org/n/Philippine%20Time +# (2021-05-16): +# According to the references listed in the article, +# the periods that the Philippines (Manila) observed DST or used +9 are: +# +# 1936-10-31 24:00 to 1937-01-15 24:00 +# (Proclamation No. 104, Proclamation No. 126) +# 1941-12-15 24:00 to 1945-11-30 24:00 +# (Proclamation No. 789, Proclamation No. 20) +# 1954-04-11 24:00 to 1954-06-04 24:00 +# (Proclamation No. 13, Proclamation No. 33) +# 1977-03-27 24:00 to 1977-09-21 24:00 +# (Proclamation No. 1629, Proclamation No. 1641) +# 1990-05-21 00:00 to 1990-07-28 24:00 +# (National Emergency Memorandum Order No. 17, Executive Order No. 415) +# +# Proclamation No. 104 ... October 30, 1936 +# https://www.officialgazette.gov.ph/1936/10/30/proclamation-no-104-s-1936/ +# Proclamation No. 126 ... January 15, 1937 +# https://www.officialgazette.gov.ph/1937/01/15/proclamation-no-126-s-1937/ +# Proclamation No. 789 ... December 13, 1941 +# https://www.officialgazette.gov.ph/1941/12/13/proclamation-no-789-s-1941/ +# Proclamation No. 20 ... November 11, 1945 +# https://www.officialgazette.gov.ph/1945/11/11/proclamation-no-20-s-1945/ +# Proclamation No. 13 ... April 6, 1954 +# https://www.officialgazette.gov.ph/1954/04/06/proclamation-no-13-s-1954/ +# Proclamation No. 33 ... June 3, 1954 +# https://www.officialgazette.gov.ph/1954/06/03/proclamation-no-33-s-1954/ +# Proclamation No. 1629 ... March 25, 1977 +# https://www.officialgazette.gov.ph/1977/03/25/proclamation-no-1629-s-1977/ +# Proclamation No. 1641 ...May 26, 1977 +# https://www.officialgazette.gov.ph/1977/05/26/proclamation-no-1641-s-1977/ +# National Emergency Memorandum Order No. 17 ... May 2, 1990 +# https://www.officialgazette.gov.ph/1990/05/02/national-emergency-memorandum-order-no-17-s-1990/ +# Executive Order No. 415 ... July 20, 1990 +# https://www.officialgazette.gov.ph/1990/07/20/executive-order-no-415-s-1990/ +# +# During WWII, Proclamation No. 789 fixed two periods of DST. The first period +# was set to continue only until January 31, 1942. But Manila was occupied by +# the Japanese earlier in the month.... +# +# For the date of the adoption of standard time, Shank[s] gives 1899-05-11. +# The article is not able to state the basis of that. I guess it was based on +# a US War Department Circular issued on that date. +# https://books.google.com/books?id=JZ1PAAAAYAAJ&pg=RA3-PA8 +# +# However, according to other sources, standard time was adopted on +# 1899-09-06. Also, the LMT was GMT+8:03:52 +# https://books.google.com/books?id=MOYIAQAAIAAJ&pg=PA521 +# https://books.google.com/books?id=lSnqqatpYikC&pg=PA21 +# +# From Paul Eggert (2024-09-05): +# The penultimate URL in P Chan's email refers to page 521 of +# Selga M, The Time Service in the Philippines. +# Proc Pan-Pacific Science Congress. Vol. 1 (1923), 519-532. +# It says, "The change from the meridian 120° 58' 04" to the 120th implied a +# change of 3 min. 52s.26 in time; consequently on 6th September, 1899, +# Manila Observatory gave the noon signal 3 min. 52s.26 later than before". +# +# Wikipedia says the US declared Manila liberated on March 4, 1945; +# this doesn't affect clocks, just our time zone abbreviation and DST flag. # From Paul Goyette (2018-06-15) with URLs updated by Guy Harris (2024-02-15): # In the Philippines, there is a national law, Republic Act No. 10535 @@ -3720,24 +3769,26 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # influence of the sources. There is no current abbreviation for DST, # so use "PDT", the usual American style. -# From P Chan (2021-05-10): -# Here's a fairly comprehensive article in Japanese: -# https://wiki.suikawiki.org/n/Philippine%20Time -# From Paul Eggert (2021-05-10): -# The info in the Japanese table has not been absorbed (yet) below. - # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Phil 1936 only - Nov 1 0:00 1:00 D -Rule Phil 1937 only - Feb 1 0:00 0 S -Rule Phil 1954 only - Apr 12 0:00 1:00 D -Rule Phil 1954 only - Jul 1 0:00 0 S -Rule Phil 1978 only - Mar 22 0:00 1:00 D -Rule Phil 1978 only - Sep 21 0:00 0 S +Rule Phil 1936 only - Oct 31 24:00 1:00 D +Rule Phil 1937 only - Jan 15 24:00 0 S +Rule Phil 1941 only - Dec 15 24:00 1:00 D +# The following three rules were canceled by Japan: +#Rule Phil 1942 only - Jan 31 24:00 0 S +#Rule Phil 1942 only - Mar 1 0:00 1:00 D +#Rule Phil 1942 only - Jun 30 24:00 0 S +Rule Phil 1945 only - Nov 30 24:00 0 S +Rule Phil 1954 only - Apr 11 24:00 1:00 D +Rule Phil 1954 only - Jun 4 24:00 0 S +Rule Phil 1977 only - Mar 27 24:00 1:00 D +Rule Phil 1977 only - Sep 21 24:00 0 S +Rule Phil 1990 only - May 21 0:00 1:00 D +Rule Phil 1990 only - Jul 28 24:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31 - 8:04:00 - LMT 1899 May 11 - 8:00 Phil P%sT 1942 May - 9:00 - JST 1944 Nov +Zone Asia/Manila -15:56:08 - LMT 1844 Dec 31 + 8:03:52 - LMT 1899 Sep 6 4:00u + 8:00 Phil P%sT 1942 Feb 11 24:00 + 9:00 - JST 1945 Mar 4 8:00 Phil P%sT # Bahrain diff --git a/src/java.base/share/data/tzdata/australasia b/src/java.base/share/data/tzdata/australasia index 09698826a49..d659d1fb4b1 100644 --- a/src/java.base/share/data/tzdata/australasia +++ b/src/java.base/share/data/tzdata/australasia @@ -1262,10 +1262,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # The 1992 ending date used in the rules is a best guess; # it matches what was used in the past. -# The Australian Bureau of Meteorology FAQ -# http://www.bom.gov.au/faq/faqgen.htm -# (1999-09-27) writes that Giles Meteorological Station uses -# South Australian time even though it's located in Western Australia. +# From Christopher Hunt (2006-11-21), after an advance warning +# from Jesper Nørgaard Welen (2006-11-01): +# WA are trialing DST for three years. +# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf # From Paul Eggert (2018-04-01): # The Guardian Express of Perth, Australia reported today that the @@ -1277,54 +1277,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # https://www.communitynews.com.au/guardian-express/news/exclusive-daylight-savings-coming-wa-summer-2018/ # [The article ends with "Today's date is April 1."] -# Queensland - -# From Paul Eggert (2018-02-26): -# I lack access to the following source for Queensland DST: -# Pearce C. History of daylight saving time in Queensland. -# Queensland Hist J. 2017 Aug;23(6):389-403 -# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS - -# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): -# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] -# # [ Dec 1990 ] -# ... -# Zone Australia/Queensland 10:00 AQ %sST -# ... -# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D -# Rule AQ 1972 only - Feb lastSun 3:00 0 E -# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D -# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E - -# From Bradley White (1989-12-24): -# "Australia/Queensland" now observes daylight time (i.e. from -# October 1989). - -# From Bradley White (1991-03-04): -# A recent excerpt from an Australian newspaper... -# ...Queensland...[has] agreed to end daylight saving -# at 3am tomorrow (March 3)... - -# From John Mackin (1991-03-06): -# I can certainly confirm for my part that Daylight Saving in NSW did in fact -# end on Sunday, 3 March. I don't know at what hour, though. (It surprised -# me.) - -# From Bradley White (1992-03-08): -# ...there was recently a referendum in Queensland which resulted -# in the experimental daylight saving system being abandoned. So, ... -# ... -# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D -# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S -# ... - -# From Arthur David Olson (1992-03-08): -# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. - -# From Christopher Hunt (2006-11-21), after an advance warning -# from Jesper Nørgaard Welen (2006-11-01): -# WA are trialing DST for three years. -# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf +# The Australian Bureau of Meteorology FAQ +# http://www.bom.gov.au/faq/faqgen.htm +# (1999-09-27) writes that Giles Meteorological Station uses +# South Australian time even though it's located in Western Australia. # From Rives McDow (2002-04-09): # The most interesting region I have found consists of three towns on the @@ -1382,6 +1338,59 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # For lack of better info, assume the tradition dates back to the # introduction of standard time in 1895. +# From Stuart Bishop (2024-11-12): +# An article discussing the in-use but technically unofficial timezones +# in the Western Australian portion of the Nullarbor Plain. +# https://www.abc.net.au/news/2024-11-22/outback-wa-properties-strange-time-zones/104542494 +# From Paul Eggert (2024-11-12): +# As the article says, the Eyre Bird Observatory and nearby sheep stations +# can use Tokyo time. Other possibilities include Asia/Chita, Asia/Seoul, +# and Asia/Jayapura. + +# Queensland + +# From Paul Eggert (2018-02-26): +# I lack access to the following source for Queensland DST: +# Pearce C. History of daylight saving time in Queensland. +# Queensland Hist J. 2017 Aug;23(6):389-403 +# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS + +# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): +# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] +# # [ Dec 1990 ] +# ... +# Zone Australia/Queensland 10:00 AQ %sST +# ... +# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D +# Rule AQ 1972 only - Feb lastSun 3:00 0 E +# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D +# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E + +# From Bradley White (1989-12-24): +# "Australia/Queensland" now observes daylight time (i.e. from +# October 1989). + +# From Bradley White (1991-03-04): +# A recent excerpt from an Australian newspaper... +# ...Queensland...[has] agreed to end daylight saving +# at 3am tomorrow (March 3)... + +# From John Mackin (1991-03-06): +# I can certainly confirm for my part that Daylight Saving in NSW did in fact +# end on Sunday, 3 March. I don't know at what hour, though. (It surprised +# me.) + +# From Bradley White (1992-03-08): +# ...there was recently a referendum in Queensland which resulted +# in the experimental daylight saving system being abandoned. So, ... +# ... +# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D +# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S +# ... + +# From Arthur David Olson (1992-03-08): +# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. + # southeast Australia # diff --git a/src/java.base/share/data/tzdata/etcetera b/src/java.base/share/data/tzdata/etcetera index 780c835819d..41660b05dba 100644 --- a/src/java.base/share/data/tzdata/etcetera +++ b/src/java.base/share/data/tzdata/etcetera @@ -74,6 +74,10 @@ Link Etc/GMT GMT # so we moved the names into the Etc subdirectory. # Also, the time zone abbreviations are now compatible with %z. +# There is no "Etc/Unknown" entry, as CLDR says that "Etc/Unknown" +# corresponds to an unknown or invalid time zone, and things would get +# confusing if Etc/Unknown were made valid here. + Zone Etc/GMT-14 14 - %z Zone Etc/GMT-13 13 - %z Zone Etc/GMT-12 12 - %z diff --git a/src/java.base/share/data/tzdata/europe b/src/java.base/share/data/tzdata/europe index df203f218d1..7ba6c679609 100644 --- a/src/java.base/share/data/tzdata/europe +++ b/src/java.base/share/data/tzdata/europe @@ -1170,7 +1170,7 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn # However, Greenland will change to Daylight Saving Time again in 2024 # and onwards. -# From a contributor who wishes to remain anonymous for now (2023-10-29): +# From Jule Dabars (2023-10-29): # https://www.dr.dk/nyheder/seneste/i-nat-skal-uret-stilles-en-time-tilbage-men-foerste-gang-sker-det-ikke-i-groenland # with a link to that page: # https://naalakkersuisut.gl/Nyheder/2023/10/2710_sommertid diff --git a/src/java.base/share/data/tzdata/factory b/src/java.base/share/data/tzdata/factory index a05346a301d..e5e7d88f5f6 100644 --- a/src/java.base/share/data/tzdata/factory +++ b/src/java.base/share/data/tzdata/factory @@ -31,5 +31,15 @@ # time zone abbreviation "-00", indicating that the actual time zone # is unknown. +# TZ="Factory" was added to TZDB in 1989, and in 2016 its abbreviation +# was changed to "-00" from a longish English-language error message. +# Around 2010, CLDR added "Etc/Unknown" for use with TZDB, to stand +# for an unknown or invalid time zone. These two notions differ: +# TZ="Factory" is a valid timezone, so tzalloc("Factory") succeeds, whereas +# TZ="Etc/Unknown" is invalid and tzalloc("Etc/Unknown") fails. +# Also, a downstream distributor could modify Factory to be a +# default timezone suitable for the devices it manufactures, +# whereas that cannot happen for Etc/Unknown. + # Zone NAME STDOFF RULES FORMAT Zone Factory 0 - -00 diff --git a/src/java.base/share/data/tzdata/leapseconds b/src/java.base/share/data/tzdata/leapseconds index 63a76620dbf..042a32b052c 100644 --- a/src/java.base/share/data/tzdata/leapseconds +++ b/src/java.base/share/data/tzdata/leapseconds @@ -92,11 +92,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2025 Jun 28 00:00:00 +#Expires 2025 Dec 28 00:00:00 # POSIX timestamps for the data in this file: -#updated 1720104763 (2024-07-04 14:52:43 UTC) -#expires 1751068800 (2025-06-28 00:00:00 UTC) +#updated 1736208000 (2025-01-07 00:00:00 UTC) +#expires 1766880000 (2025-12-28 00:00:00 UTC) # Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# File expires on 28 June 2025 +# File expires on 28 December 2025 diff --git a/src/java.base/share/data/tzdata/northamerica b/src/java.base/share/data/tzdata/northamerica index c95e7d0e643..0a54e63becc 100644 --- a/src/java.base/share/data/tzdata/northamerica +++ b/src/java.base/share/data/tzdata/northamerica @@ -50,9 +50,12 @@ # in New York City (1869-10). His 1870 proposal was based on Washington, DC, # but in 1872-05 he moved the proposed origin to Greenwich. -# From Paul Eggert (2018-03-20): +# From Paul Eggert (2024-11-18): # Dowd's proposal left many details unresolved, such as where to draw -# lines between time zones. The key individual who made time zones +# lines between time zones. Sandford Fleming of the Canadian Pacific Railway +# argued for Dowd's proposal in 1876, and Cleveland Abbe of the American +# Meteorology Society published a report in 1879 recommending four US time +# zones based on GMT. However, the key individual who made time zones # work in the US was William Frederick Allen - railway engineer, # managing editor of the Travelers' Guide, and secretary of the # General Time Convention, a railway standardization group. Allen @@ -2654,7 +2657,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 # http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/ # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Mexico 1931 only - April 30 0:00 1:00 D +Rule Mexico 1931 only - Apr 30 0:00 1:00 D Rule Mexico 1931 only - Oct 1 0:00 0 S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S diff --git a/src/java.base/share/data/tzdata/southamerica b/src/java.base/share/data/tzdata/southamerica index 3824202546a..0a5859600e8 100644 --- a/src/java.base/share/data/tzdata/southamerica +++ b/src/java.base/share/data/tzdata/southamerica @@ -1710,7 +1710,7 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 - # and that on the first Sunday of the month of October, it is to be set # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... -Rule Para 2010 max - Oct Sun>=1 0:00 1:00 - +Rule Para 2010 2024 - Oct Sun>=1 0:00 1:00 - Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): @@ -1729,14 +1729,35 @@ Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # https://www.abc.com.py/politica/2023/07/12/promulgacion-el-cambio-de-hora-sera-por-ley/ # From Carlos Raúl Perasso (2023-07-27): # http://silpy.congreso.gov.py/descarga/ley-144138 -Rule Para 2013 max - Mar Sun>=22 0:00 0 - +Rule Para 2013 2024 - Mar Sun>=22 0:00 0 - +# +# From Heitor David Pinto (2024-09-24): +# Today the Congress of Paraguay passed a bill to observe UTC-3 permanently.... +# The text of the bill says that it would enter into force on the first +# Sunday in October 2024, the same date currently scheduled to start DST.... +# https://silpy.congreso.gov.py/web/expediente/132531 +# (2024-10-14): +# The president approved the law on 11 October 2024, +# and it was officially published on 14 October 2024. +# https://www.gacetaoficial.gov.py/index/detalle_publicacion/89723 +# The text of the law says that it enters into force on the first +# Sunday in October 2024 (6 October 2024). But the constitution +# prohibits retroactive effect, and the civil code says that laws +# enter into force on the day after their publication or on the day +# that they specify, and it also says that they don't have retroactive +# effect. So I think that the time change on 6 October 2024 should +# still be considered as DST according to the previous law, and +# permanently UTC-3 from 15 October 2024 according to the new law.... +# https://www.constituteproject.org/constitution/Paraguay_2011 +# https://www.oas.org/dil/esp/codigo_civil_paraguay.pdf # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 -3:50:40 - AMT 1931 Oct 10 # Asunción Mean Time -4:00 - %z 1972 Oct -3:00 - %z 1974 Apr - -4:00 Para %z + -4:00 Para %z 2024 Oct 15 + -3:00 - %z # Peru # diff --git a/test/jdk/java/util/TimeZone/TimeZoneData/VERSION b/test/jdk/java/util/TimeZone/TimeZoneData/VERSION index f40be22e9ab..5159b3786e3 100644 --- a/test/jdk/java/util/TimeZone/TimeZoneData/VERSION +++ b/test/jdk/java/util/TimeZone/TimeZoneData/VERSION @@ -1 +1 @@ -tzdata2024b +tzdata2025a diff --git a/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt b/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt index 3217f68b825..c8d855453c2 100644 --- a/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt +++ b/test/jdk/java/util/TimeZone/TimeZoneData/aliases.txt @@ -1,6 +1,3 @@ -Link Asia/Riyadh87 Mideast/Riyadh87 -Link Asia/Riyadh88 Mideast/Riyadh88 -Link Asia/Riyadh89 Mideast/Riyadh89 Link Australia/Sydney Australia/ACT #= Australia/Canberra Link Australia/Lord_Howe Australia/LHI Link Australia/Sydney Australia/NSW From ceed3c0edafdbf74ddb6e616df4d177704f449fe Mon Sep 17 00:00:00 2001 From: Theo Weidmann Date: Thu, 23 Jan 2025 08:41:02 +0000 Subject: [PATCH 04/24] 8341696: C2: Non-fluid StringBuilder pattern bails out in OptoStringConcat Reviewed-by: epeter --- .../stringopts/TestFluidAndNonFluid.java | 134 ++++++++++++++++++ .../bench/vm/compiler/FluidSBBench.java | 61 ++++++++ 2 files changed, 195 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/stringopts/TestFluidAndNonFluid.java create mode 100644 test/micro/org/openjdk/bench/vm/compiler/FluidSBBench.java diff --git a/test/hotspot/jtreg/compiler/stringopts/TestFluidAndNonFluid.java b/test/hotspot/jtreg/compiler/stringopts/TestFluidAndNonFluid.java new file mode 100644 index 00000000000..fc4ffaddb86 --- /dev/null +++ b/test/hotspot/jtreg/compiler/stringopts/TestFluidAndNonFluid.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2025 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + /* + * @test + * @bug 8341696 + * @summary Allow C2 to also optimize non-fluid string builder calls. + * @library /test/lib / + * @run driver compiler.c2.irTests.stringopts.TestFluidAndNonFluid + */ +package compiler.c2.irTests.stringopts; + +import compiler.lib.ir_framework.*; +import jdk.test.lib.Asserts; + +public class TestFluidAndNonFluid { + + public static int unknown = 1; + + public static void main(String[] args) { + // Dont inline any StringBuilder methods for this IR test to check if string opts are applied or not. + TestFramework.runWithFlags("-XX:CompileCommand=dontinline,java.lang.StringBuilder::*"); + } + + @DontInline + public static void opaque(StringBuilder builder) { + builder.append("Z"); + } + + @Run(test = {"fluid", "nonFluid", "nonFinal", "nonFluidExtraneousVariable", "nonFluidConditional", + "nonFluidOpaqueCall"}) + public void runMethod() { + Asserts.assertEQ("0ac", fluidNoParam()); + Asserts.assertEQ("ac", nonFluidNoParam()); + Asserts.assertEQ("ac", fluid("c")); + Asserts.assertEQ("ac", nonFluid("c")); + Asserts.assertEQ("ac", nonFinal("c")); + Asserts.assertEQ("ac", nonFluidExtraneousVariable("c")); + Asserts.assertEQ("ac", nonFluidConditional("c")); + Asserts.assertEQ("aZ", nonFluidOpaqueCall()); + } + + @Test + @IR(failOn = {IRNode.ALLOC_OF, "StringBuilder", IRNode.CALL_OF_METHOD, "toString", IRNode.INTRINSIC_TRAP}) + public static String fluidNoParam() { + return new StringBuilder("0").append("a").append("c").toString(); + } + + @Test + @IR(failOn = {IRNode.ALLOC_OF, "StringBuilder", IRNode.CALL_OF_METHOD, "toString", IRNode.INTRINSIC_TRAP}) + public static String nonFluidNoParam() { + final StringBuilder sb = new StringBuilder(); + sb.append("a"); + sb.append("c"); + return sb.toString(); + } + + @Test + @IR(failOn = {IRNode.ALLOC_OF, "StringBuilder", IRNode.CALL_OF_METHOD, "toString"}) + public static String fluid(String a) { + return new StringBuilder().append("a").append(a).toString(); + } + + @Test + @IR(failOn = {IRNode.ALLOC_OF, "StringBuilder", IRNode.CALL_OF_METHOD, "toString"}) + public static String nonFluid(String a) { + final StringBuilder sb = new StringBuilder(); + sb.append("a"); + sb.append(a); + return sb.toString(); + } + + @Test + @IR(failOn = {IRNode.ALLOC_OF, "StringBuilder", IRNode.CALL_OF_METHOD, "toString"}) + public static String nonFinal(String a) { + StringBuilder sb = new StringBuilder(); + sb.append("a"); + sb.append(a); + return sb.toString(); + } + + @Test + @IR(failOn = {IRNode.ALLOC_OF, "StringBuilder", IRNode.CALL_OF_METHOD, "toString"}) + public static String nonFluidExtraneousVariable(String a) { + final StringBuilder sb = new StringBuilder(); + final StringBuilder x = sb; + sb.append("a"); + x.append(a); + return sb.toString(); + } + + @Test + @IR(counts = {IRNode.ALLOC_OF, "StringBuilder", "1", IRNode.CALL_OF_METHOD, "toString", "1"}) + @IR(failOn = IRNode.INTRINSIC_TRAP) + static String nonFluidConditional(String a) { + final StringBuilder sb = new StringBuilder(); + sb.append("a"); + if (unknown == 1) { + sb.append(a); + } + return sb.toString(); + } + + @Test + @IR(counts = {IRNode.ALLOC_OF, "StringBuilder", "1", IRNode.CALL_OF_METHOD, "toString", "1"}) + @IR(failOn = IRNode.INTRINSIC_TRAP) + static String nonFluidOpaqueCall() { + final StringBuilder sb = new StringBuilder(); + sb.append("a"); + opaque(sb); + return sb.toString(); + } + +} diff --git a/test/micro/org/openjdk/bench/vm/compiler/FluidSBBench.java b/test/micro/org/openjdk/bench/vm/compiler/FluidSBBench.java new file mode 100644 index 00000000000..794ff768678 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/compiler/FluidSBBench.java @@ -0,0 +1,61 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * Copyright (c) 2025, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.bench.vm.compiler; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Scope; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 300, timeUnit = TimeUnit.MILLISECONDS) +@Measurement(iterations = 3, time = 300, timeUnit = TimeUnit.MILLISECONDS) +@Fork(value = 1, jvmArgsAppend = {"-XX:+UseParallelGC", "-Xmx1g", "-Xms1g"}) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +public class FluidSBBench { + static final String PREFIX = "a"; + String foo = "aaaaa aaaaa aaaaa aaaaa aaaaa"; + + @Benchmark + public String fluid() { + return new StringBuilder().append(PREFIX).append(foo).toString(); + } + + @Benchmark + public String nonFluid() { + final StringBuilder sb = new StringBuilder(); + sb.append(PREFIX); + sb.append(foo); + return sb.toString(); + } +} From f668b410ef93141355b0dac805b8538c81938780 Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Thu, 23 Jan 2025 09:28:51 +0000 Subject: [PATCH 05/24] 8344966: Remove the allowNonPublic MBean compatibility property Reviewed-by: amenkov, sspitsyn, dfuchs --- .../com/sun/jmx/mbeanserver/Introspector.java | 6 +- .../sun/jmx/mbeanserver/MBeanAnalyzer.java | 5 +- .../share/classes/javax/management/JMX.java | 5 +- .../MBeanServer/MBeanFallbackTest.java | 94 ---------------- .../management/mxbean/MXBeanFallbackTest.java | 85 --------------- .../proxy/JMXProxyFallbackTest.java | 100 ------------------ 6 files changed, 6 insertions(+), 289 deletions(-) delete mode 100644 test/jdk/javax/management/MBeanServer/MBeanFallbackTest.java delete mode 100644 test/jdk/javax/management/mxbean/MXBeanFallbackTest.java delete mode 100644 test/jdk/javax/management/proxy/JMXProxyFallbackTest.java diff --git a/src/java.management/share/classes/com/sun/jmx/mbeanserver/Introspector.java b/src/java.management/share/classes/com/sun/jmx/mbeanserver/Introspector.java index 374dd57a4ee..a6aa5fea55a 100644 --- a/src/java.management/share/classes/com/sun/jmx/mbeanserver/Introspector.java +++ b/src/java.management/share/classes/com/sun/jmx/mbeanserver/Introspector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2025, 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 @@ -64,7 +64,6 @@ * @since 1.5 */ public class Introspector { - public static final boolean ALLOW_NONPUBLIC_MBEAN = Boolean.parseBoolean(System.getProperty("jdk.jmx.mbeans.allowNonPublic")); /* * ------------------------------------------ @@ -517,8 +516,7 @@ private static Class implementsMBean(Class c, String clName) { Class[] interfaces = c.getInterfaces(); for (int i = 0;i < interfaces.length; i++) { if (interfaces[i].getName().equals(clMBeanName) && - (Modifier.isPublic(interfaces[i].getModifiers()) || - ALLOW_NONPUBLIC_MBEAN)) { + Modifier.isPublic(interfaces[i].getModifiers())) { return Util.cast(interfaces[i]); } } diff --git a/src/java.management/share/classes/com/sun/jmx/mbeanserver/MBeanAnalyzer.java b/src/java.management/share/classes/com/sun/jmx/mbeanserver/MBeanAnalyzer.java index 06d2d05a527..b72c8f6748e 100644 --- a/src/java.management/share/classes/com/sun/jmx/mbeanserver/MBeanAnalyzer.java +++ b/src/java.management/share/classes/com/sun/jmx/mbeanserver/MBeanAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, 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 @@ -107,8 +107,7 @@ private MBeanAnalyzer(Class mbeanType, if (!mbeanType.isInterface()) { throw new NotCompliantMBeanException("Not an interface: " + mbeanType.getName()); - } else if (!Modifier.isPublic(mbeanType.getModifiers()) && - !Introspector.ALLOW_NONPUBLIC_MBEAN) { + } else if (!Modifier.isPublic(mbeanType.getModifiers())) { throw new NotCompliantMBeanException("Interface is not public: " + mbeanType.getName()); } diff --git a/src/java.management/share/classes/javax/management/JMX.java b/src/java.management/share/classes/javax/management/JMX.java index 82b14c691b4..7cc3884b6df 100644 --- a/src/java.management/share/classes/javax/management/JMX.java +++ b/src/java.management/share/classes/javax/management/JMX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, 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 @@ -375,8 +375,7 @@ public static T newMXBeanProxy(MBeanServerConnection connection, public static boolean isMXBeanInterface(Class interfaceClass) { if (!interfaceClass.isInterface()) return false; - if (!Modifier.isPublic(interfaceClass.getModifiers()) && - !Introspector.ALLOW_NONPUBLIC_MBEAN) { + if (!Modifier.isPublic(interfaceClass.getModifiers())) { return false; } MXBean a = interfaceClass.getAnnotation(MXBean.class); diff --git a/test/jdk/javax/management/MBeanServer/MBeanFallbackTest.java b/test/jdk/javax/management/MBeanServer/MBeanFallbackTest.java deleted file mode 100644 index 6cf508598de..00000000000 --- a/test/jdk/javax/management/MBeanServer/MBeanFallbackTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import javax.management.MBeanServer; -import javax.management.MBeanServerFactory; -import javax.management.NotCompliantMBeanException; -import javax.management.ObjectName; - -/* - * @test - * @bug 8010285 - * @summary Test fallback for private MBean interfaces. - * It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic" - * system property must be set before c.s.j.m.MBeanAnalyzer has been loaded. - * @author Jaroslav Bachorik - * - * @run clean MBeanFallbackTest - * @run build MBeanFallbackTest - * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MBeanFallbackTest - */ -public class MBeanFallbackTest { - private static interface PrivateMBean { - public int[] getInts(); - } - - public static class Private implements PrivateMBean { - public int[] getInts() { - return new int[]{1,2,3}; - } - } - - private static int failures = 0; - - public static void main(String[] args) throws Exception { - testPrivate(PrivateMBean.class, new Private()); - - if (failures == 0) - System.out.println("Test passed"); - else - throw new Exception("TEST FAILURES: " + failures); - } - - private static void fail(String msg) { - failures++; - System.out.println("FAIL: " + msg); - } - - private static void success(String msg) { - System.out.println("OK: " + msg); - } - - private static void testPrivate(Class iface, Object bean) throws Exception { - try { - System.out.println("Registering a private MBean " + - iface.getName() + " ..."); - - MBeanServer mbs = MBeanServerFactory.newMBeanServer(); - ObjectName on = new ObjectName("test:type=Compliant"); - - mbs.registerMBean(bean, on); - success("Registered a private MBean - " + iface.getName()); - } catch (Exception e) { - Throwable t = e; - while (t != null && !(t instanceof NotCompliantMBeanException)) { - t = t.getCause(); - } - if (t != null) { - fail("MBean not registered"); - } else { - throw e; - } - } - } -} diff --git a/test/jdk/javax/management/mxbean/MXBeanFallbackTest.java b/test/jdk/javax/management/mxbean/MXBeanFallbackTest.java deleted file mode 100644 index 00fd1c454c2..00000000000 --- a/test/jdk/javax/management/mxbean/MXBeanFallbackTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2005, 2015, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8010285 - * @summary Test for the private MXBean interface fallback. - * It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic" - * system property must be set before c.s.j.m.MBeanAnalyzer has been loaded. - * @author Jaroslav Bachorik - * - * @run clean MXBeanFallbackTest - * @run build MXBeanFallbackTest - * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MXBeanFallbackTest - */ - -import javax.management.MBeanServer; -import javax.management.MBeanServerFactory; -import javax.management.NotCompliantMBeanException; -import javax.management.ObjectName; - -public class MXBeanFallbackTest { - public static void main(String[] args) throws Exception { - testPrivateMXBean("Private", new Private()); - - if (failures == 0) - System.out.println("Test passed"); - else - throw new Exception("TEST FAILURES: " + failures); - } - - private static int failures = 0; - - private static interface PrivateMXBean { - public int[] getInts(); - } - - public static class Private implements PrivateMXBean { - public int[] getInts() { - return new int[]{1,2,3}; - } - } - - private static void testPrivateMXBean(String type, Object bean) throws Exception { - System.out.println(type + " MXBean test..."); - MBeanServer mbs = MBeanServerFactory.newMBeanServer(); - ObjectName on = new ObjectName("test:type=" + type); - try { - mbs.registerMBean(bean, on); - success("Private MXBean registered"); - } catch (NotCompliantMBeanException e) { - failure("Failed to register the private MXBean - " + - bean.getClass().getInterfaces()[0].getName()); - } - } - - private static void success(String what) { - System.out.println("OK: " + what); - } - - private static void failure(String what) { - System.out.println("FAILED: " + what); - failures++; - } -} diff --git a/test/jdk/javax/management/proxy/JMXProxyFallbackTest.java b/test/jdk/javax/management/proxy/JMXProxyFallbackTest.java deleted file mode 100644 index c68a93654af..00000000000 --- a/test/jdk/javax/management/proxy/JMXProxyFallbackTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2013, 2015, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import javax.management.JMX; -import javax.management.MBeanServer; -import javax.management.MBeanServerFactory; -import javax.management.NotCompliantMBeanException; -import javax.management.ObjectName; - -/* - * @test - * @bug 8010285 - * @summary Tests the fallback for creating JMX proxies for private interfaces - * It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic" - * system property must be set before c.s.j.m.MBeanAnalyzer has been loaded. - * @author Jaroslav Bachorik - * - * @run clean JMXProxyFallbackTest - * @run build JMXProxyFallbackTest - * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true JMXProxyFallbackTest - */ -public class JMXProxyFallbackTest { - private static interface PrivateMBean { - public int[] getInts(); - } - - private static interface PrivateMXBean { - public int[] getInts(); - } - - public static class Private implements PrivateMXBean, PrivateMBean { - public int[] getInts() { - return new int[]{1,2,3}; - } - } - - private static int failures = 0; - - public static void main(String[] args) throws Exception { - testPrivate(PrivateMBean.class); - testPrivate(PrivateMXBean.class); - - if (failures == 0) - System.out.println("Test passed"); - else - throw new Exception("TEST FAILURES: " + failures); - } - - private static void fail(String msg) { - failures++; - System.out.println("FAIL: " + msg); - } - - private static void success(String msg) { - System.out.println("OK: " + msg); - } - - private static void testPrivate(Class iface) throws Exception { - try { - System.out.println("Creating a proxy for private M(X)Bean " + - iface.getName() + " ..."); - - MBeanServer mbs = MBeanServerFactory.newMBeanServer(); - ObjectName on = new ObjectName("test:type=Proxy"); - - JMX.newMBeanProxy(mbs, on, iface); - success("Created a proxy for private M(X)Bean - " + iface.getName()); - } catch (Exception e) { - Throwable t = e; - while (t != null && !(t instanceof NotCompliantMBeanException)) { - t = t.getCause(); - } - if (t != null) { - fail("Proxy not created"); - } else { - throw e; - } - } - } -} From 32e598e9e91ab28129a6ed8935dc18e34e473e58 Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Thu, 23 Jan 2025 09:30:03 +0000 Subject: [PATCH 06/24] 8344969: Remove the jmx.mxbean.multiname compatibility property Reviewed-by: sspitsyn, amenkov, dfuchs --- .../com/sun/jmx/mbeanserver/MXBeanLookup.java | 7 ++----- .../mxbean/SameObjectTwoNamesTest.java | 20 ++++--------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/java.management/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java b/src/java.management/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java index 0027710d06a..19df1e9c695 100644 --- a/src/java.management/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java +++ b/src/java.management/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2025, 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 @@ -144,11 +144,8 @@ synchronized void addReference(ObjectName name, Object mxbean) throws InstanceAlreadyExistsException { ObjectName existing = mxbeanToObjectName.get(mxbean); if (existing != null) { - String multiname = System.getProperty("jmx.mxbean.multiname"); - if (!"true".equalsIgnoreCase(multiname)) { - throw new InstanceAlreadyExistsException( + throw new InstanceAlreadyExistsException( "MXBean already registered with name " + existing); - } } mxbeanToObjectName.put(mxbean, name); } diff --git a/test/jdk/javax/management/mxbean/SameObjectTwoNamesTest.java b/test/jdk/javax/management/mxbean/SameObjectTwoNamesTest.java index 10022c592f7..130289e10da 100644 --- a/test/jdk/javax/management/mxbean/SameObjectTwoNamesTest.java +++ b/test/jdk/javax/management/mxbean/SameObjectTwoNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2025, 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 @@ -30,7 +30,6 @@ * @author Eamonn McManus * * @run main SameObjectTwoNamesTest - * @run main/othervm -Djmx.mxbean.multiname=true SameObjectTwoNamesTest */ import javax.management.InstanceAlreadyExistsException; @@ -41,8 +40,6 @@ public class SameObjectTwoNamesTest { public static void main(String[] args) throws Exception { - boolean expectException = - (System.getProperty("jmx.mxbean.multiname") == null); try { ObjectName objectName1 = new ObjectName("test:index=1"); ObjectName objectName2 = new ObjectName("test:index=2"); @@ -53,19 +50,10 @@ public static void main(String[] args) throws Exception { mbs.registerMBean(mxBeanObject, objectName2); - if (expectException) { - throw new Exception("TEST FAILED: " + - "InstanceAlreadyExistsException was not thrown"); - } else - System.out.println("Correctly got no exception with compat property"); + throw new Exception("TEST FAILED: InstanceAlreadyExistsException was not thrown"); } catch (InstanceAlreadyExistsException e) { - if (expectException) { - System.out.println("Got expected InstanceAlreadyExistsException:"); - e.printStackTrace(System.out); - } else { - throw new Exception( - "TEST FAILED: Got exception even though compat property set", e); - } + System.out.println("Got expected InstanceAlreadyExistsException:"); + e.printStackTrace(System.out); } System.out.println("TEST PASSED"); } From e9daa614dace25a99ade9c7e4b7cd89c3f75b859 Mon Sep 17 00:00:00 2001 From: Theo Weidmann Date: Thu, 23 Jan 2025 10:16:33 +0000 Subject: [PATCH 07/24] 8348388: Incorrect copyright header in TestFluidAndNonFluid.java Reviewed-by: epeter, chagedorn --- .../hotspot/jtreg/compiler/stringopts/TestFluidAndNonFluid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/compiler/stringopts/TestFluidAndNonFluid.java b/test/hotspot/jtreg/compiler/stringopts/TestFluidAndNonFluid.java index fc4ffaddb86..34fbaa1b6ed 100644 --- a/test/hotspot/jtreg/compiler/stringopts/TestFluidAndNonFluid.java +++ b/test/hotspot/jtreg/compiler/stringopts/TestFluidAndNonFluid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 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 From c9e5f5fa983082bf1fca452f2225588151d0686c Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 23 Jan 2025 10:50:39 +0000 Subject: [PATCH 08/24] 8348303: Remove repeated 'a' from ListSelectionEvent Reviewed-by: azvegint, honkar, dmarkov, prr, kizune --- .../javax/swing/event/ListSelectionEvent.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java.desktop/share/classes/javax/swing/event/ListSelectionEvent.java b/src/java.desktop/share/classes/javax/swing/event/ListSelectionEvent.java index c0e04878d63..f5d9ad48b5d 100644 --- a/src/java.desktop/share/classes/javax/swing/event/ListSelectionEvent.java +++ b/src/java.desktop/share/classes/javax/swing/event/ListSelectionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, 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 @@ -26,11 +26,11 @@ package javax.swing.event; import java.util.EventObject; -import javax.swing.*; +import javax.swing.ListSelectionModel; /** - * An event that characterizes a change in selection. The change is limited to a + * An event that characterizes a change in selection. The change is limited to * a single inclusive interval. The selection of at least one index within the * range will have changed. A decent {@code ListSelectionModel} implementation * will keep the range as small as possible. {@code ListSelectionListeners} will @@ -64,8 +64,8 @@ public class ListSelectionEvent extends EventObject * have changed. * * @param source the {@code Object} on which the event initially occurred - * @param firstIndex the first index in the range, <= lastIndex - * @param lastIndex the last index in the range, >= firstIndex + * @param firstIndex the first index in the range, <= {@code lastIndex} + * @param lastIndex the last index in the range, >= {@code firstIndex} * @param isAdjusting whether or not this is one in a series of * multiple events, where changes are still being made */ @@ -111,7 +111,7 @@ public ListSelectionEvent(Object source, int firstIndex, int lastIndex, * Returns a {@code String} that displays and identifies this * object's properties. * - * @return a String representation of this object + * @return a string representation of this object */ public String toString() { String properties = From 55656f48c5ccb92124fbeae5646b1a2d2841d03f Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 23 Jan 2025 10:51:53 +0000 Subject: [PATCH 09/24] 8348308: Make fields of ListSelectionEvent final Reviewed-by: honkar, azvegint --- .../share/classes/javax/swing/event/ListSelectionEvent.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java.desktop/share/classes/javax/swing/event/ListSelectionEvent.java b/src/java.desktop/share/classes/javax/swing/event/ListSelectionEvent.java index f5d9ad48b5d..6225e55186f 100644 --- a/src/java.desktop/share/classes/javax/swing/event/ListSelectionEvent.java +++ b/src/java.desktop/share/classes/javax/swing/event/ListSelectionEvent.java @@ -53,9 +53,9 @@ @SuppressWarnings("serial") // Same-version serialization only public class ListSelectionEvent extends EventObject { - private int firstIndex; - private int lastIndex; - private boolean isAdjusting; + private final int firstIndex; + private final int lastIndex; + private final boolean isAdjusting; /** * Represents a change in selection status between {@code firstIndex} and From f6e6568305e924b95f3f0e7d04c9c3ecb42e7b0f Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Thu, 23 Jan 2025 11:06:11 +0000 Subject: [PATCH 10/24] 8345048: Remove the jmx.extend.open.types compatibility property Reviewed-by: cjplummer, amenkov, sspitsyn --- .../share/classes/javax/management/openmbean/OpenType.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/java.management/share/classes/javax/management/openmbean/OpenType.java b/src/java.management/share/classes/javax/management/openmbean/OpenType.java index a81359a7fe9..de2663bdc7f 100644 --- a/src/java.management/share/classes/javax/management/openmbean/OpenType.java +++ b/src/java.management/share/classes/javax/management/openmbean/OpenType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, 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 @@ -194,10 +194,7 @@ private void checkClassNameOverride() throws SecurityException { if (this.getClass().getClassLoader() == null) return; // We trust bootstrap classes. if (overridesGetClassName(this.getClass())) { - if (System.getProperty("jmx.extend.open.types") == null) { - throw new SecurityException("Cannot override getClassName() " + - "unless -Djmx.extend.open.types"); - } + throw new SecurityException("Cannot override getClassName()"); } } From ca5cfe599684003bb4bd5549467fd8f31489e94b Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Thu, 23 Jan 2025 11:39:38 +0000 Subject: [PATCH 11/24] 8345045: Remove the jmx.remote.x.buffer.size JMX notification property Reviewed-by: amenkov, sspitsyn --- .../com/sun/jmx/remote/util/EnvHelp.java | 16 +----------- .../NotifBufferSizePropertyNameTest.java | 26 ++++++------------- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java b/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java index a64db45c22f..54d1f45c6ce 100644 --- a/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java +++ b/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, 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 @@ -262,21 +262,11 @@ public static Throwable getCause(Throwable t) { public static int getNotifBufferSize(Map env) { int defaultQueueSize = 1000; // default value - // keep it for the compatibility for the fix: - // 6174229: Environment parameter should be notification.buffer.size - // instead of buffer.size - final String oldP = "jmx.remote.x.buffer.size"; - // the default value re-specified in the system try { String s = System.getProperty(BUFFER_SIZE_PROPERTY); if (s != null) { defaultQueueSize = Integer.parseInt(s); - } else { // try the old one - s = System.getProperty(oldP); - if (s != null) { - defaultQueueSize = Integer.parseInt(s); - } } } catch (RuntimeException e) { logger.warning("getNotifBufferSize", @@ -292,10 +282,6 @@ public static int getNotifBufferSize(Map env) { queueSize = (int)EnvHelp.getIntegerAttribute(env,BUFFER_SIZE_PROPERTY, defaultQueueSize,0, Integer.MAX_VALUE); - } else { // try the old one - queueSize = (int)EnvHelp.getIntegerAttribute(env,oldP, - defaultQueueSize,0, - Integer.MAX_VALUE); } } catch (RuntimeException e) { logger.warning("getNotifBufferSize", diff --git a/test/jdk/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java b/test/jdk/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java index 94a06904282..8f4fe0a24f0 100644 --- a/test/jdk/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java +++ b/test/jdk/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2025, 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 @@ -23,7 +23,7 @@ /* * @test NotifBufferSizePropertyNameTest - * @bug 6174229 + * @bug 6174229 8345045 * @summary Verify the property name specifying server notification buffer size. * @author Shanliang JIANG * @@ -52,35 +52,25 @@ public void handleNotification(Notification n, Object hb) { }; public static void main(String[] args) throws Exception { - System.out.println( - "Verify the property name specifying the server notification buffer size."); + System.out.println("Verify the property name specifying the server notification buffer size."); oname = new ObjectName ("Default:name=NotificationEmitter"); url = new JMXServiceURL("rmi", null, 0); Map env = new HashMap(2); - System.out.println("Test the new property name."); + System.out.println("Test the property name."); env.put("jmx.remote.x.notification.buffer.size", String.valueOf(bufferSize)); test(env); - System.out.println("Test the old property name."); - env.remove("jmx.remote.x.notification.buffer.size"); - env.put("jmx.remote.x.buffer.size", String.valueOf(bufferSize)); - test(env); - + // Recognition of the old, incorrect property "jmx.remote.x.buffer.size" has been dropped. + // Do not test old name is recognised, but do test it does not interfere with correct name: System.out.println("Test that the new property name overwrite the old one."); env.put("jmx.remote.x.notification.buffer.size", String.valueOf(bufferSize)); env.put("jmx.remote.x.buffer.size", String.valueOf(bufferSize*6)); test(env); - System.out.println("Test the old property name on system."); - System.setProperty("jmx.remote.x.buffer.size", String.valueOf(bufferSize)); - test(null); - - System.out.println( - "Test that the new property name overwrite the old one on system."); - System.setProperty("jmx.remote.x.notification.buffer.size", - String.valueOf(bufferSize)); + System.out.println("Test that the new property name overwrite the old one on system."); + System.setProperty("jmx.remote.x.notification.buffer.size", String.valueOf(bufferSize)); System.setProperty("jmx.remote.x.buffer.size", String.valueOf(bufferSize*6)); test(null); } From 1ca14578d717959c5f7ee387af0fdd58955dfb01 Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Thu, 23 Jan 2025 11:41:16 +0000 Subject: [PATCH 12/24] 8345049: Remove the jmx.tabular.data.hash.map compatibility property Reviewed-by: cjplummer, sspitsyn, dfuchs --- .../openmbean/TabularDataSupport.java | 11 +---- .../openmbean/TabularDataOrderTest.java | 42 +------------------ 2 files changed, 3 insertions(+), 50 deletions(-) diff --git a/src/java.management/share/classes/javax/management/openmbean/TabularDataSupport.java b/src/java.management/share/classes/javax/management/openmbean/TabularDataSupport.java index 94c804d9029..d670d2da782 100644 --- a/src/java.management/share/classes/javax/management/openmbean/TabularDataSupport.java +++ b/src/java.management/share/classes/javax/management/openmbean/TabularDataSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, 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 @@ -143,16 +143,9 @@ public TabularDataSupport(TabularType tabularType, int initialCapacity, float lo List tmpNames = tabularType.getIndexNames(); this.indexNamesArray = tmpNames.toArray(new String[tmpNames.size()]); - // Since LinkedHashMap was introduced in SE 1.4, it's conceivable even - // if very unlikely that we might be the server of a 1.3 client. In - // that case you'll need to set this property. See CR 6334663. - boolean useHashMap = Boolean.getBoolean("jmx.tabular.data.hash.map"); - // Construct the empty contents HashMap // - this.dataMap = useHashMap ? - new HashMap<>(initialCapacity, loadFactor) : - new LinkedHashMap<>(initialCapacity, loadFactor); + this.dataMap = new LinkedHashMap<>(initialCapacity, loadFactor); } diff --git a/test/jdk/javax/management/openmbean/TabularDataOrderTest.java b/test/jdk/javax/management/openmbean/TabularDataOrderTest.java index 68e9fefdc7c..0a1a02c949f 100644 --- a/test/jdk/javax/management/openmbean/TabularDataOrderTest.java +++ b/test/jdk/javax/management/openmbean/TabularDataOrderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2025, 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 @@ -57,8 +57,6 @@ public class TabularDataOrderTest { private static String failure; - private static final String COMPAT_PROP_NAME = "jmx.tabular.data.hash.map"; - private static final String[] intNames = { "unus", "duo", "tres", "quatuor", "quinque", "sex", "septem", "octo", "novem", "decim", @@ -129,44 +127,6 @@ public static void main(String[] args) throws Exception { if (!ordered) fail("Order not preserved"); - // Now test the undocumented property that causes HashMap to be used - // instead of LinkedHashMap, in case serializing to a 1.3 client. - // We serialize and deserialize in case the implementation handles - // this at serialization time. Then we look at object fields; that's - // not guaranteed to work but at worst it will fail spuriously and - // we'll have to update the test. - System.out.println("Testing compatible behaviour"); - System.setProperty(COMPAT_PROP_NAME, "true"); - td = makeTable(); - System.out.println(td); - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - ObjectOutputStream oout = new ObjectOutputStream(bout); - oout.writeObject(td); - oout.close(); - byte[] bytes = bout.toByteArray(); - ByteArrayInputStream bin = new ByteArrayInputStream(bytes); - ObjectInputStream oin = new ObjectInputStream(bin); - td = (TabularData) oin.readObject(); - boolean found = false; - for (Field f : td.getClass().getDeclaredFields()) { - if (Modifier.isStatic(f.getModifiers())) - continue; - f.setAccessible(true); - Object x = f.get(td); - if (x != null && x.getClass() == HashMap.class) { - found = true; - System.out.println( - x.getClass().getName() + " TabularDataSupport." + - f.getName() + " = " + x); - break; - } - } - if (!found) { - fail("TabularDataSupport does not contain HashMap though " + - COMPAT_PROP_NAME + "=true"); - } - System.clearProperty(COMPAT_PROP_NAME); - System.out.println("Testing MXBean behaviour"); MBeanServer mbs = MBeanServerFactory.newMBeanServer(); ObjectName name = new ObjectName("a:b=c"); From 4a48bf93250709579702d1ddb269655f974bd57d Mon Sep 17 00:00:00 2001 From: Serhiy Sachkov Date: Thu, 23 Jan 2025 13:40:20 +0000 Subject: [PATCH 13/24] 8347994: Add additional diagnostics to macOS failure handler to assist with diagnosing MCast test failures Reviewed-by: dfuchs --- test/failure_handler/src/share/conf/mac.properties | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/failure_handler/src/share/conf/mac.properties b/test/failure_handler/src/share/conf/mac.properties index 6a1c9fb4e77..e04b49e0fcf 100644 --- a/test/failure_handler/src/share/conf/mac.properties +++ b/test/failure_handler/src/share/conf/mac.properties @@ -89,8 +89,9 @@ environment=\ process.ps process.top \ memory.vmstat \ files \ - net.netstat.anv net.netstat.av net.netstat.aL net.netstat.m net.netstat.s \ + net.netstat.anv net.netstat.av net.netstat.aL net.netstat.m net.netstat.s net.netstat.g net.netstat.r \ net.ifconfig net.hostsfile \ + fw.up \ scutil.nwi scutil.proxy \ screenshot ################################################################################ @@ -132,6 +133,8 @@ net.netstat.anv.args=-anv net.netstat.aL.args=-aL net.netstat.m.args=-mm net.netstat.s.args=-s +net.netstat.g.args=-gs +net.netstat.r.args=-rn net.ifconfig.app=ifconfig net.ifconfig.args=-a @@ -144,4 +147,7 @@ scutil.proxy.args=--proxy screenshot.app=screencapture screenshot.args=-x screen1.png screen2.png screen3.png screen4.png screen5.png + +fw.app=/usr/libexec/ApplicationFirewall/socketfilterfw +fw.up.args=--getglobalstate ################################################################################ From e8fffff1703c45acc71522f484d69593f2b35316 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 23 Jan 2025 14:47:14 +0000 Subject: [PATCH 14/24] 8348392: Make claims "other matches are possible" even when that is not true Reviewed-by: erikj --- make/InitSupport.gmk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk index eea593a80db..fdd351be6d2 100644 --- a/make/InitSupport.gmk +++ b/make/InitSupport.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2025, 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 @@ -211,13 +211,15 @@ ifeq ($(HAS_SPEC), ) $$(if $$(findstring $$(CONF), $$(var)), $$(var)))) endif ifneq ($$(filter $$(CONF), $$(matching_confs)), ) + ifneq ($$(word 2, $$(matching_confs)), ) + # Don't repeat this output on make restarts caused by including + # generated files. + ifeq ($$(MAKE_RESTARTS), ) + $$(info Using exact match for CONF=$$(CONF) (other matches are possible)) + endif + endif # If we found an exact match, use that matching_confs := $$(CONF) - # Don't repeat this output on make restarts caused by including - # generated files. - ifeq ($$(MAKE_RESTARTS), ) - $$(info Using exact match for CONF=$$(CONF) (other matches are possible)) - endif endif endif ifeq ($$(matching_confs), ) From 5dc0dcf3b542706163020c1c3dab87af195ea038 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 23 Jan 2025 14:50:03 +0000 Subject: [PATCH 15/24] 8348391: Keep case if possible for TOPDIR Reviewed-by: erikj --- make/autoconf/basic.m4 | 6 ++++++ make/autoconf/util_paths.m4 | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/make/autoconf/basic.m4 b/make/autoconf/basic.m4 index f574174a12e..35eb63bea0c 100644 --- a/make/autoconf/basic.m4 +++ b/make/autoconf/basic.m4 @@ -84,9 +84,15 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS], # We get the top-level directory from the supporting wrappers. BASIC_WINDOWS_VERIFY_DIR($TOPDIR, source) + orig_topdir="$TOPDIR" UTIL_FIXUP_PATH(TOPDIR) AC_MSG_CHECKING([for top-level directory]) AC_MSG_RESULT([$TOPDIR]) + if test "x$TOPDIR" != "x$orig_topdir"; then + AC_MSG_WARN([Your top dir was originally represented as $orig_topdir,]) + AC_MSG_WARN([but after rewriting it became $TOPDIR.]) + AC_MSG_WARN([This typically means you have characters like space in the path, which can cause all kind of trouble.]) + fi AC_SUBST(TOPDIR) if test "x$CUSTOM_ROOT" != x; then diff --git a/make/autoconf/util_paths.m4 b/make/autoconf/util_paths.m4 index 7717150dfd9..57e53b53641 100644 --- a/make/autoconf/util_paths.m4 +++ b/make/autoconf/util_paths.m4 @@ -77,7 +77,10 @@ AC_DEFUN([UTIL_FIXUP_PATH], imported_path="" fi fi - if test "x$imported_path" != "x$path"; then + [ imported_path_lower=`$ECHO $imported_path | $TR '[:upper:]' '[:lower:]'` ] + [ orig_path_lower=`$ECHO $path | $TR '[:upper:]' '[:lower:]'` ] + # If only case differs, keep original path + if test "x$imported_path_lower" != "x$orig_path_lower"; then $1="$imported_path" fi else From eccd126c2a10994df74dc99ff8215c7fc8464b52 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 23 Jan 2025 14:51:32 +0000 Subject: [PATCH 16/24] 8348387: Add fixpath if needed for user-supplied tools Reviewed-by: erikj --- make/autoconf/util_paths.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make/autoconf/util_paths.m4 b/make/autoconf/util_paths.m4 index 57e53b53641..9e3e5472c9e 100644 --- a/make/autoconf/util_paths.m4 +++ b/make/autoconf/util_paths.m4 @@ -360,6 +360,8 @@ AC_DEFUN([UTIL_SETUP_TOOL], fi $1="$tool_command" fi + # Make sure we add fixpath if needed + UTIL_FIXUP_EXECUTABLE($1) if test "x$tool_args" != x; then # If we got arguments, re-append them to the command after the fixup. $1="[$]$1 $tool_args" From 3756b28875658220147cb25cc1a51695c245a4c3 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 23 Jan 2025 15:18:38 +0000 Subject: [PATCH 17/24] 8348299: Update List/ItemEventTest/ItemEventTest.java Use thread-safe StringBuffer to track selecting/deselecting items. Use auto waitForIdle for all events. Log handleEvent and ItemListener. Take screenshot of the list on failure; Optionally take screenshot after each mouse press+release. Reviewed-by: azvegint, prr, kizune --- .../awt/List/ItemEventTest/ItemEventTest.java | 144 +++++++++++------- 1 file changed, 90 insertions(+), 54 deletions(-) diff --git a/test/jdk/java/awt/List/ItemEventTest/ItemEventTest.java b/test/jdk/java/awt/List/ItemEventTest/ItemEventTest.java index c5d45379905..ea0f339c92b 100644 --- a/test/jdk/java/awt/List/ItemEventTest/ItemEventTest.java +++ b/test/jdk/java/awt/List/ItemEventTest/ItemEventTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, 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 @@ -27,8 +27,13 @@ * @bug 8033936 8172510 * @summary Verify that correct ItemEvent is received while selection & * deselection of multi select List items. + * @library /test/lib + * @build jdk.test.lib.Platform + * @run main ItemEventTest */ +// Pass -save to the test to enable screenshots at each select/deselect + import java.awt.AWTException; import java.awt.Event; import java.awt.FlowLayout; @@ -37,26 +42,30 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.Robot; -import java.awt.event.KeyEvent; import java.awt.event.InputEvent; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; - -public class ItemEventTest extends Frame -{ - List list; - final String expectedSelectionOrder; - StringBuilder actualSelectionOrder; - Robot robot; - - public ItemEventTest() - { - try { - robot = new Robot(); - } catch(AWTException e) { - throw new RuntimeException(e.getMessage()); - } - expectedSelectionOrder = "01230123"; +import java.awt.event.KeyEvent; +import java.awt.image.RenderedImage; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import jdk.test.lib.Platform; + +public final class ItemEventTest extends Frame { + private static final String expectedSelectionOrder = "01230123"; + + private static boolean saveScreenshots; + + private final StringBuffer actualSelectionOrder + = new StringBuffer(expectedSelectionOrder.length()); + + private final List list; + private final Robot robot; + + private ItemEventTest() throws AWTException { + robot = new Robot(); + robot.setAutoWaitForIdle(true); list = new List(4, true); list.add("0"); @@ -65,71 +74,76 @@ public ItemEventTest() list.add("3"); add(list); + setSize(400,400); setLayout(new FlowLayout()); pack(); + setLocationRelativeTo(null); setVisible(true); robot.waitForIdle(); } @Override + @SuppressWarnings("deprecation") public boolean handleEvent(Event e) { - if (e.target instanceof List) { - if (e.id == Event.LIST_DESELECT || e.id == Event.LIST_SELECT) { - actualSelectionOrder.append(e.arg); - } + if ((e.target instanceof List) + && (e.id == Event.LIST_DESELECT + || e.id == Event.LIST_SELECT)) { + logEvent("handleEvent: ", e.arg); } return true; } - void testHandleEvent() { + private void logEvent(String method, Object listItem) { + actualSelectionOrder.append(listItem); + System.out.println(method + listItem); + } + + private void testHandleEvent() { // When no ItemListener is added to List, parent's handleEvent is // called with ItemEvent. performTest(); } - void testItemListener() { - list.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent ie) { - actualSelectionOrder.append(ie.getItem()); - } - }); + private void testItemListener() { + list.addItemListener(ie + -> logEvent("testItemListener: ", ie.getItem())); performTest(); } - void performTest() { - actualSelectionOrder = new StringBuilder(); - Point loc = list.getLocationOnScreen(); - Rectangle rect = list.getBounds(); - int dY = rect.height / list.getItemCount(); - loc = new Point(loc.x + 10, loc.y + 5); + private void performTest() { + actualSelectionOrder.setLength(0); + + final Rectangle rect = getListBoundsOnScreen(); + final int dY = rect.height / list.getItemCount(); + final Point loc = new Point(rect.x + rect.width / 2, + rect.y + dY / 2); - String osName = System.getProperty("os.name"); - boolean isMac = osName.contains("Mac") || osName.contains("mac"); - if(isMac) { + if (Platform.isOSX()) { robot.keyPress(KeyEvent.VK_META); - robot.waitForIdle(); } // First loop to select & Second loop to deselect the list items. for (int j = 0; j < 2; ++j) { for (int i = 0; i < list.getItemCount(); ++i) { robot.mouseMove(loc.x, loc.y + i * dY); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.waitForIdle(); - robot.mouseRelease(InputEvent.BUTTON1_MASK); - robot.waitForIdle(); + + if (saveScreenshots) { + saveImage(robot.createScreenCapture(rect)); + } } } - if(isMac) { + if (Platform.isOSX()) { robot.keyRelease(KeyEvent.VK_META); } - if (!expectedSelectionOrder.equals(actualSelectionOrder.toString())) { - dispose(); + if (!expectedSelectionOrder.contentEquals(actualSelectionOrder)) { + saveImage(robot.createScreenCapture(rect)); + throw new RuntimeException("ItemEvent for selection & deselection" + " of multi select List's item is not correct" + " Expected : " + expectedSelectionOrder @@ -137,10 +151,32 @@ void performTest() { } } - public static void main(String args[]) { - ItemEventTest test = new ItemEventTest(); - test.testHandleEvent(); - test.testItemListener(); - test.dispose(); + private Rectangle getListBoundsOnScreen() { + return new Rectangle(list.getLocationOnScreen(), + list.getSize()); + } + + private static int imageNo = 0; + + private static void saveImage(RenderedImage image) { + try { + ImageIO.write(image, + "png", + new File(String.format("image-%02d.png", + ++imageNo))); + } catch (IOException ignored) { + } + } + + public static void main(String[] args) throws AWTException { + saveScreenshots = args.length > 0 && "-save".equals(args[0]); + + ItemEventTest test = new ItemEventTest(); + try { + test.testHandleEvent(); + test.testItemListener(); + } finally { + test.dispose(); + } } } From d3fe9d33ab5a71a6b614fcb4d9e18d973ca93e84 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 23 Jan 2025 16:49:00 +0000 Subject: [PATCH 18/24] 8348301: Remove unused Reference.waitForReferenceProcessing break-ins in tests Reviewed-by: alanb --- .../FileInputStreamPoolTest.java | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/test/jdk/sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java b/test/jdk/sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java index 860b2d99910..32bdea4e153 100644 --- a/test/jdk/sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java +++ b/test/jdk/sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java @@ -25,7 +25,6 @@ * @test * @bug 8047769 * @modules java.base/java.io:open - * java.base/java.lang.ref:open * java.base/sun.security.provider:open * @summary SecureRandom should be more frugal with file descriptors */ @@ -133,11 +132,9 @@ public static void main(String[] args) throws Exception { /** * A proxy for (package)private static methods: * sun.security.provider.FileInputStreamPool.getInputStream - * java.lang.ref.Reference.waitForReferenceProcessing */ static class TestProxy { private static final Method getInputStreamMethod; - private static final Method waitForReferenceProcessingMethod; private static final Field inField; static { @@ -149,10 +146,6 @@ static class TestProxy { "getInputStream", File.class); getInputStreamMethod.setAccessible(true); - waitForReferenceProcessingMethod = - Reference.class.getDeclaredMethod("waitForReferenceProcessing"); - waitForReferenceProcessingMethod.setAccessible(true); - inField = FilterInputStream.class.getDeclaredField("in"); inField.setAccessible(true); } catch (Exception e) { @@ -180,25 +173,6 @@ static InputStream FileInputStreamPool_getInputStream(File file) } } - static boolean Reference_waitForReferenceProcessing() { - try { - return (boolean) waitForReferenceProcessingMethod.invoke(null); - } catch (InvocationTargetException e) { - Throwable te = e.getTargetException(); - if (te instanceof InterruptedException) { - return true; - } else if (te instanceof RuntimeException) { - throw (RuntimeException) te; - } else if (te instanceof Error) { - throw (Error) te; - } else { - throw new UndeclaredThrowableException(te); - } - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } - } - static FileInputStream FilterInputStream_getInField(FilterInputStream fis) { try { return (FileInputStream) inField.get(fis); From 9f23a58124a63d6fe3f22b3c454615cb99ce493e Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Thu, 23 Jan 2025 17:24:33 +0000 Subject: [PATCH 19/24] 8348365: Bad format string in CLDRDisplayNamesTest Reviewed-by: shade, naoto --- test/jdk/java/util/TimeZone/CLDRDisplayNamesTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/java/util/TimeZone/CLDRDisplayNamesTest.java b/test/jdk/java/util/TimeZone/CLDRDisplayNamesTest.java index 2ff278a583c..158692676a9 100644 --- a/test/jdk/java/util/TimeZone/CLDRDisplayNamesTest.java +++ b/test/jdk/java/util/TimeZone/CLDRDisplayNamesTest.java @@ -130,7 +130,7 @@ public static void main(String[] args) { String displayName = zi.getDisplayName(false, TimeZone.SHORT, Locale.US); Locale.setDefault(originalLocale); if (!displayName.equals("GMT+05:00")) { - System.err.printf("Wrong display name for timezone Etc/GMT-5 : expected GMT+05:00, Actual " + displayName); + System.err.println("Wrong display name for timezone Etc/GMT-5 : expected GMT+05:00, Actual " + displayName); errors++; } From 6975384bee495dc8ca59548858fd56a16c8642e3 Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Thu, 23 Jan 2025 18:37:37 +0000 Subject: [PATCH 20/24] 8348327: Incorrect march flag when building libsleef/vector_math_neon.c Reviewed-by: erikj, vlivanov, shade --- make/modules/jdk.incubator.vector/Lib.gmk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/modules/jdk.incubator.vector/Lib.gmk b/make/modules/jdk.incubator.vector/Lib.gmk index 69da7ed059a..7d2ef440b67 100644 --- a/make/modules/jdk.incubator.vector/Lib.gmk +++ b/make/modules/jdk.incubator.vector/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2021, 2025, 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 @@ -64,7 +64,7 @@ ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, aarch64)+$(INCLUDE_COMPILER2 EXTRA_SRC := libsleef/generated, \ DISABLED_WARNINGS_gcc := unused-function sign-compare tautological-compare ignored-qualifiers, \ DISABLED_WARNINGS_clang := unused-function sign-compare tautological-compare ignored-qualifiers, \ - CFLAGS := $(SVE_CFLAGS), \ + vector_math_sve.c_CFLAGS := $(SVE_CFLAGS), \ )) TARGETS += $(BUILD_LIBSLEEF) From 321a1593aafd8497b966d9205fbfc4f4c6271a98 Mon Sep 17 00:00:00 2001 From: Mikhail Yankelevich Date: Thu, 23 Jan 2025 18:59:21 +0000 Subject: [PATCH 21/24] 8348406: Remove tests GrantAllPermToExtWhenNoPolicy and PrincipalExpansionError from problem list Reviewed-by: rhalade --- test/jdk/ProblemList.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 43d050d4e9c..be14ed51517 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -1,6 +1,6 @@ ########################################################################### # -# Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2025, 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 @@ -636,8 +636,6 @@ sun/security/smartcardio/TestTransmit.java 8039280 generic- com/sun/security/sasl/gsskerb/AuthOnly.java 8039280 generic-all com/sun/security/sasl/gsskerb/ConfSecurityLayer.java 8039280 generic-all com/sun/security/sasl/gsskerb/NoSecurityLayer.java 8039280 generic-all -sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.java 8039280 generic-all -sun/security/provider/PolicyParser/PrincipalExpansionError.java 8039280 generic-all sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8316183 linux-ppc64le From f1ba0debd077dd56f76e64a3922ee2ed76096ebb Mon Sep 17 00:00:00 2001 From: Rajat Mahajan Date: Thu, 23 Jan 2025 20:52:45 +0000 Subject: [PATCH 22/24] 8282862: AwtWindow::SetIconData leaks old icon handles if an exception is detected Reviewed-by: aivanov, dmarkov, prr, honkar, azvegint --- .../native/libawt/windows/awt_Window.cpp | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp index f632da02162..d5bbdc51b0b 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2025, 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 @@ -2110,20 +2110,49 @@ HICON CreateIconFromRaster(JNIEnv* env, jintArray iconRaster, jint w, jint h) void AwtWindow::SetIconData(JNIEnv* env, jintArray iconRaster, jint w, jint h, jintArray smallIconRaster, jint smw, jint smh) { + HICON hNewIcon = NULL; + HICON hNewIconSm = NULL; + + try { + hNewIcon = CreateIconFromRaster(env, iconRaster, w, h); + if (env->ExceptionCheck()) { + if (hNewIcon != NULL) { + DestroyIcon(hNewIcon); + } + return; + } + + hNewIconSm = CreateIconFromRaster(env, smallIconRaster, smw, smh); + if (env->ExceptionCheck()) { + if (hNewIcon != NULL) { + DestroyIcon(hNewIcon); + } + if (hNewIconSm != NULL) { + DestroyIcon(hNewIconSm); + } + return; + } + } catch (...) { + if (hNewIcon != NULL) { + DestroyIcon(hNewIcon); + } + if (hNewIconSm != NULL) { + DestroyIcon(hNewIconSm); + } + return; + } + HICON hOldIcon = NULL; HICON hOldIconSm = NULL; - //Destroy previous icon if it isn't inherited if ((m_hIcon != NULL) && !m_iconInherited) { hOldIcon = m_hIcon; } - m_hIcon = NULL; if ((m_hIconSm != NULL) && !m_iconInherited) { hOldIconSm = m_hIconSm; } - m_hIconSm = NULL; - m_hIcon = CreateIconFromRaster(env, iconRaster, w, h); - JNU_CHECK_EXCEPTION(env); - m_hIconSm = CreateIconFromRaster(env, smallIconRaster, smw, smh); + + m_hIcon = hNewIcon; + m_hIconSm = hNewIconSm; m_iconInherited = (m_hIcon == NULL); if (m_iconInherited) { @@ -2136,8 +2165,11 @@ void AwtWindow::SetIconData(JNIEnv* env, jintArray iconRaster, jint w, jint h, m_iconInherited = FALSE; } } + DoUpdateIcon(); EnumThreadWindows(AwtToolkit::MainThread(), UpdateOwnedIconCallback, (LPARAM)this); + + // Destroy previous icons if they were not inherited if (hOldIcon != NULL) { DestroyIcon(hOldIcon); } From 783d94fdd3cee823087e64383fcb059e6c7f0552 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Thu, 23 Jan 2025 22:02:48 +0000 Subject: [PATCH 23/24] 8348240: Remove SystemDictionaryShared::lookup_super_for_unregistered_class() Reviewed-by: ccheung, coleenp --- .../share/classes/jdk/internal/misc/CDS.java | 114 +++++++++++++++++- .../appcds/customLoader/ClassListFormatE.java | 19 ++- 2 files changed, 128 insertions(+), 5 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/misc/CDS.java b/src/java.base/share/classes/jdk/internal/misc/CDS.java index 8661a2b3ff2..e22baf72c82 100644 --- a/src/java.base/share/classes/jdk/internal/misc/CDS.java +++ b/src/java.base/share/classes/jdk/internal/misc/CDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, 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 @@ -31,6 +31,10 @@ import java.io.InputStream; import java.io.IOException; import java.io.PrintStream; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; import java.util.Arrays; import java.util.ArrayList; import java.util.List; @@ -337,4 +341,112 @@ private static String dumpSharedArchive(boolean isStatic, String fileName) throw System.out.println("The process was attached by jcmd and dumped a " + (isStatic ? "static" : "dynamic") + " archive " + archiveFilePath); return archiveFilePath; } + + /** + * This class is used only by native JVM code at CDS dump time for loading + * "unregistered classes", which are archived classes that are intended to + * be loaded by custom class loaders during runtime. + * See src/hotspot/share/cds/unregisteredClasses.cpp. + */ + private static class UnregisteredClassLoader extends URLClassLoader { + private String currentClassName; + private Class currentSuperClass; + private Class[] currentInterfaces; + + /** + * Used only by native code. Construct an UnregisteredClassLoader for loading + * unregistered classes from the specified file. If the file doesn't exist, + * the exception will be caughted by native code which will print a warning message and continue. + * + * @param fileName path of the the JAR file to load unregistered classes from. + */ + private UnregisteredClassLoader(String fileName) throws InvalidPathException, IOException { + super(toURLArray(fileName), /*parent*/null); + currentClassName = null; + currentSuperClass = null; + currentInterfaces = null; + } + + private static URL[] toURLArray(String fileName) throws InvalidPathException, IOException { + if (!((new File(fileName)).exists())) { + throw new IOException("No such file: " + fileName); + } + return new URL[] { + // Use an intermediate File object to construct a URI/URL without + // authority component as URLClassPath can't handle URLs with a UNC + // server name in the authority component. + Path.of(fileName).toRealPath().toFile().toURI().toURL() + }; + } + + + /** + * Load the class of the given /name from the JAR file that was given to + * the constructor of the current UnregisteredClassLoader instance. This class must be + * a direct subclass of superClass. This class must be declared to implement + * the specified interfaces. + *

+ * This method must be called in a single threaded context. It will never be recursed (thus + * the asserts) + * + * @param name the name of the class to be loaded. + * @param superClass must not be null. The named class must have a super class. + * @param interfaces could be null if the named class does not implement any interfaces. + */ + private Class load(String name, Class superClass, Class[] interfaces) + throws ClassNotFoundException + { + assert currentClassName == null; + assert currentSuperClass == null; + assert currentInterfaces == null; + + try { + currentClassName = name; + currentSuperClass = superClass; + currentInterfaces = interfaces; + + return findClass(name); + } finally { + currentClassName = null; + currentSuperClass = null; + currentInterfaces = null; + } + } + + /** + * This method must be called from inside the load() method. The /name + * can be only: + *

    + *
  • the name parameter for load() + *
  • the name of the superClass parameter for load() + *
  • the name of one of the interfaces in interfaces parameter for load() + *
      + * + * For all other cases, a ClassNotFoundException will be thrown. + */ + protected Class findClass(final String name) + throws ClassNotFoundException + { + Objects.requireNonNull(currentClassName); + Objects.requireNonNull(currentSuperClass); + + if (name.equals(currentClassName)) { + // Note: the following call will call back to this.findClass(name) to + // resolve the super types of the named class. + return super.findClass(name); + } + if (name.equals(currentSuperClass.getName())) { + return currentSuperClass; + } + if (currentInterfaces != null) { + for (Class c : currentInterfaces) { + if (name.equals(c.getName())) { + return c; + } + } + } + + throw new ClassNotFoundException(name); + } + } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/customLoader/ClassListFormatE.java b/test/hotspot/jtreg/runtime/cds/appcds/customLoader/ClassListFormatE.java index b5386c54afb..2beb39d0b39 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/customLoader/ClassListFormatE.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/customLoader/ClassListFormatE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, 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 @@ -49,14 +49,15 @@ public static void main(String[] args) throws Throwable { //---------------------------------------------------------------------- // TESTGROUP E: super class and interfaces //---------------------------------------------------------------------- - dumpShouldFail( + dumpShouldPass( "TESTCASE E1: missing interfaces: keyword", appJar, classlist( "Hello", "java/lang/Object id: 1", "CustomLoadee2 id: 1 super: 1 source: " + customJarPath ), - "Class CustomLoadee2 implements the interface CustomInterface2_ia, but no interface has been specified in the input line"); + "java.lang.NoClassDefFoundError: CustomInterface2_ia", + "Cannot find CustomLoadee2"); dumpShouldFail( "TESTCASE E2: missing one interface", @@ -67,7 +68,7 @@ appJar, classlist( "CustomInterface2_ib id: 3 super: 1 source: " + customJarPath, "CustomLoadee2 id: 4 super: 1 interfaces: 2 source: " + customJarPath ), - "The interface CustomInterface2_ib implemented by class CustomLoadee2 does not match any of the specified interface IDs"); + "The number of interfaces (1) specified in class list does not match the class file (2)"); dumpShouldFail( "TESTCASE E3: specifying an interface that's not implemented by the class", @@ -101,5 +102,15 @@ appJar, classlist( "CustomLoadee2 id: 5 super: 4 interfaces: 2 3 source: " + customJarPath ), "The specified super class CustomLoadee (id 4) does not match actual super class java.lang.Object"); + + dumpShouldPass( + "TESTCASE E6: JAR file doesn't exist", + appJar, classlist( + "Hello", + "java/lang/Object id: 1", + "NoSuchClass id: 2 super: 1 source: no_such_file.jar" + ), + "Cannot find NoSuchClass", + "java.io.IOException: No such file: no_such_file.jar"); } } From 0357236ebd9ffa2b97f4ce730a4769fbc3df5631 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 24 Jan 2025 00:29:49 +0000 Subject: [PATCH 24/24] 8343609: Broken links in java.xml Reviewed-by: naoto, lancea, iris --- .../classes/javax/xml/catalog/Catalog.java | 5 +- .../javax/xml/catalog/CatalogFeatures.java | 9 +- .../javax/xml/catalog/CatalogManager.java | 6 +- .../javax/xml/catalog/CatalogResolver.java | 4 +- .../classes/javax/xml/catalog/Normalizer.java | 5 +- .../javax/xml/catalog/package-info.java | 6 +- .../classes/javax/xml/namespace/QName.java | 111 ++++++------------ 7 files changed, 53 insertions(+), 93 deletions(-) diff --git a/src/java.xml/share/classes/javax/xml/catalog/Catalog.java b/src/java.xml/share/classes/javax/xml/catalog/Catalog.java index bab7152543e..47dbe35c53f 100644 --- a/src/java.xml/share/classes/javax/xml/catalog/Catalog.java +++ b/src/java.xml/share/classes/javax/xml/catalog/Catalog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, 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,8 +29,7 @@ /** * The Catalog class represents an entity Catalog as defined by - * + * * XML Catalogs, OASIS Standard V1.1, 7 October 2005. *

      * A catalog is an XML file that contains a root {@code catalog} entry with a list diff --git a/src/java.xml/share/classes/javax/xml/catalog/CatalogFeatures.java b/src/java.xml/share/classes/javax/xml/catalog/CatalogFeatures.java index 4376bbe9fdf..32936c30e0f 100644 --- a/src/java.xml/share/classes/javax/xml/catalog/CatalogFeatures.java +++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogFeatures.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, 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 @@ -137,10 +137,9 @@ * [2] The value shall be exactly as listed in this table, case-sensitive. * Any unspecified value will result in {@link IllegalArgumentException}. *

      - * [3] The Catalog specification defined complex rules on - * - * the prefer attribute. Although the prefer can be public or system, the - * specification actually made system the preferred option, that is, no matter + * [3] The Catalog specification + * defined complex rules on the prefer attribute. Although it can be public or system, + * the specification made {@code system} the preferred option, that is, no matter * the option, a system entry is always used if found. Public entries are only * considered if the prefer is public and system entries are not found. It is * therefore recommended that the prefer attribute be set as public diff --git a/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java b/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java index 41336526e13..f859754b0db 100644 --- a/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java +++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, 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 @@ -52,7 +52,7 @@ private CatalogManager() { * those referenced by the {@code nextCatalog} elements in the main catalog. *

      * As specified in - * + * * XML Catalogs, OASIS Standard V1.1, if a catalog entry is invalid, it * is ignored. In case all entries are invalid, the resulting Catalog object * will contain no Catalog elements. Any matching operation using the Catalog @@ -126,7 +126,7 @@ public static CatalogResolver catalogResolver(Catalog catalog, CatalogResolver.N * those referenced by the {@code nextCatalog} elements in the main catalog. *

      * As specified in - * + * * XML Catalogs, OASIS Standard V1.1, if a catalog entry is invalid, it * is ignored. In case all entries are invalid, the resulting CatalogResolver * object will contain no valid catalog. Any resolution operation using the diff --git a/src/java.xml/share/classes/javax/xml/catalog/CatalogResolver.java b/src/java.xml/share/classes/javax/xml/catalog/CatalogResolver.java index 3fd4b6a7858..fd6556bafc4 100644 --- a/src/java.xml/share/classes/javax/xml/catalog/CatalogResolver.java +++ b/src/java.xml/share/classes/javax/xml/catalog/CatalogResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, 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 @@ -40,7 +40,7 @@ * Transform {@link javax.xml.transform.URIResolver}, and resolves * external references using catalogs. *

      - * The + * The * Catalog Standard distinguished {@code external identifiers} from {@code uri entries} * as being used to solely identify DTDs, while {@code uri entries} for * other resources such as stylesheets and schema. The Java APIs, such as diff --git a/src/java.xml/share/classes/javax/xml/catalog/Normalizer.java b/src/java.xml/share/classes/javax/xml/catalog/Normalizer.java index 01f1554a6b4..0c01d27437a 100644 --- a/src/java.xml/share/classes/javax/xml/catalog/Normalizer.java +++ b/src/java.xml/share/classes/javax/xml/catalog/Normalizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, 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 @@ -32,8 +32,7 @@ /** * The Normalizer is responsible for normalizing Public and System Identifiers * as specified in section 6.2, 6.3 and 6.4 of the specification - * * + * * XML Catalogs, OASIS Standard V1.1, 7 October 2005. * * @since 9 diff --git a/src/java.xml/share/classes/javax/xml/catalog/package-info.java b/src/java.xml/share/classes/javax/xml/catalog/package-info.java index 70db1b31a6c..62a8f769a07 100644 --- a/src/java.xml/share/classes/javax/xml/catalog/package-info.java +++ b/src/java.xml/share/classes/javax/xml/catalog/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, 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 @@ -26,8 +26,8 @@ /** * * Provides the classes for implementing - * - * XML Catalogs OASIS Standard V1.1, 7 October 2005. + * + * XML Catalogs OASIS Standard V1.1, 7 October 2005. * *

      * The Catalog API defines a standard solution for resolving external resources diff --git a/src/java.xml/share/classes/javax/xml/namespace/QName.java b/src/java.xml/share/classes/javax/xml/namespace/QName.java index 94121d0d334..aaab6ae5333 100644 --- a/src/java.xml/share/classes/javax/xml/namespace/QName.java +++ b/src/java.xml/share/classes/javax/xml/namespace/QName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, 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 @@ -50,9 +50,9 @@ * only the Namespace URI and local part.

      * *

      If not specified, the Namespace URI is set to {@link - * javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI}. + * XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI}. * If not specified, the prefix is set to {@link - * javax.xml.XMLConstants#DEFAULT_NS_PREFIX + * XMLConstants#DEFAULT_NS_PREFIX * XMLConstants.DEFAULT_NS_PREFIX}.

      * *

      QName is immutable.

      @@ -89,13 +89,13 @@ public class QName implements Serializable { * and local part.

      * *

      If the Namespace URI is null, it is set to - * {@link javax.xml.XMLConstants#NULL_NS_URI + * {@link XMLConstants#NULL_NS_URI * XMLConstants.NULL_NS_URI}. This value represents no * explicitly defined Namespace as defined by the Namespaces * in XML specification. This action preserves compatible * behavior with QName 1.0. Explicitly providing the {@link - * javax.xml.XMLConstants#NULL_NS_URI + * XMLConstants#NULL_NS_URI * XMLConstants.NULL_NS_URI} value is the preferred coding * style.

      * @@ -105,11 +105,11 @@ public class QName implements Serializable { * compatible behavior with QName 1.0.

      * *

      When using this constructor, the prefix is set to {@link - * javax.xml.XMLConstants#DEFAULT_NS_PREFIX + * XMLConstants#DEFAULT_NS_PREFIX * XMLConstants.DEFAULT_NS_PREFIX}.

      * *

      The Namespace URI is not validated as a - * URI reference. + * URI reference. * The local part is not validated as a * NCName * as specified in Namespaces @@ -134,13 +134,13 @@ public QName(final String namespaceURI, final String localPart) { * local part and prefix.

      * *

      If the Namespace URI is null, it is set to - * {@link javax.xml.XMLConstants#NULL_NS_URI + * {@link XMLConstants#NULL_NS_URI * XMLConstants.NULL_NS_URI}. This value represents no * explicitly defined Namespace as defined by the Namespaces * in XML specification. This action preserves compatible * behavior with QName 1.0. Explicitly providing the {@link - * javax.xml.XMLConstants#NULL_NS_URI + * XMLConstants#NULL_NS_URI * XMLConstants.NULL_NS_URI} value is the preferred coding * style.

      * @@ -151,12 +151,12 @@ public QName(final String namespaceURI, final String localPart) { * *

      If the prefix is null, an * IllegalArgumentException is thrown. Use {@link - * javax.xml.XMLConstants#DEFAULT_NS_PREFIX + * XMLConstants#DEFAULT_NS_PREFIX * XMLConstants.DEFAULT_NS_PREFIX} to explicitly indicate that no * prefix is present or the prefix is not relevant.

      * *

      The Namespace URI is not validated as a - * URI reference. + * URI reference. * The local part and prefix are not validated as a * NCName * as specified in Namespaces @@ -204,9 +204,9 @@ public QName(String namespaceURI, String localPart, String prefix) { * compatible behavior with QName 1.0.

      * *

      When using this constructor, the Namespace URI is set to - * {@link javax.xml.XMLConstants#NULL_NS_URI + * {@link XMLConstants#NULL_NS_URI * XMLConstants.NULL_NS_URI} and the prefix is set to {@link - * javax.xml.XMLConstants#DEFAULT_NS_PREFIX + * XMLConstants#DEFAULT_NS_PREFIX * XMLConstants.DEFAULT_NS_PREFIX}.

      * *

      In an XML context, all Element and Attribute names exist @@ -329,28 +329,14 @@ public final int hashCode() { } /** - *

      String representation of this - * QName.

      - * - *

      The commonly accepted way of representing a QName - * as a String was - * defined - * by James Clark. Although this is not a standard - * specification, it is in common use, e.g. {@link - * javax.xml.transform.Transformer#setParameter(String name, Object value)}. - * This implementation represents a QName as: - * "{" + Namespace URI + "}" + local part. If the Namespace URI - * .equals(XMLConstants.NULL_NS_URI), only the - * local part is returned. An appropriate use of this method is - * for debugging or logging for human consumption.

      - * - *

      Note the prefix value is NOT - * returned as part of the String representation.

      - * - *

      This method satisfies the general contract of {@link - * java.lang.Object#toString() Object.toString()}.

      - * - * @return String representation of this QName + * {@return the string representation of this {@code QName}} + * The format is: + *
       {@code
      +     *     {NamespaceURI}LocalPart
      +     * }
      + * If {@code NamespaceURI} is {@code null}, only {@code LocalPart} is returned. + * + * @apiNote The {@code Prefix} is not returned in the string representation. */ public String toString() { if (namespaceURI.equals(XMLConstants.NULL_NS_URI)) { @@ -361,48 +347,25 @@ public String toString() { } /** - *

      QName derived from parsing the formatted - * String.

      - * - *

      If the String is null or does not conform to - * {@link #toString() QName.toString()} formatting, an - * IllegalArgumentException is thrown.

      - * - *

      The String MUST be in the - * form returned by {@link #toString() QName.toString()}.

      - * - *

      The commonly accepted way of representing a QName - * as a String was - * defined - * by James Clark. Although this is not a standard - * specification, it is in common use, e.g. {@link - * javax.xml.transform.Transformer#setParameter(String name, Object value)}. - * This implementation parses a String formatted - * as: "{" + Namespace URI + "}" + local part. If the Namespace - * URI .equals(XMLConstants.NULL_NS_URI), only the - * local part should be provided.

      - * - *

      The prefix value CANNOT be - * represented in the String and will be set to - * {@link javax.xml.XMLConstants#DEFAULT_NS_PREFIX - * XMLConstants.DEFAULT_NS_PREFIX}.

      - * - *

      This method does not do full validation of the resulting - * QName. - *

      The Namespace URI is not validated as a - * URI reference. - * The local part is not validated as a + * {@return a {@code QName} from its string representation} + * The string representation must be in the format returned by {@link #toString()}: + *

       {@code
      +     *     {NamespaceURI}LocalPart
      +     * }
      + * Since the {@code Prefix} is not represented in the string form, it will be + * set to {@link XMLConstants#DEFAULT_NS_PREFIX XMLConstants.DEFAULT_NS_PREFIX}. + * + * @apiNote This method does not perform full validation of the resulting + * {@code QName}. The {@code NamespaceURI} is not validated as a + * URI reference. + * The {@code LocalPart} is not validated as a * NCName * as specified in - * Namespaces in XML.

      - * - * @param qNameAsString String representation - * of the QName - * - * @throws IllegalArgumentException When qNameAsString is - * null or malformed + * Namespaces in XML. * - * @return QName corresponding to the given String + * @param qNameAsString the string representation of the {@code QName} + * @throws IllegalArgumentException if {@code qNameAsString} is {@code null} + * or malformed * @see #toString() QName.toString() */ public static QName valueOf(String qNameAsString) {