Skip to content

Commit

Permalink
Merge upstream-jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
corretto-github-robot committed Jul 16, 2024
2 parents 0158963 + 5162e1a commit a6736bd
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 85 deletions.
18 changes: 9 additions & 9 deletions make/jdk/src/classes/build/tools/taglet/SealedGraph.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -107,7 +107,7 @@ public String toString(List<? extends DocTree> tags, Element element) {
throw new RuntimeException(e);
}

String simpleTypeName = element.getSimpleName().toString();
String simpleTypeName = packagelessCanonicalName(typeElement).replace('.', '/');
String imageFile = simpleTypeName + "-sealed-graph.svg";
int thumbnailHeight = 100; // also appears in the stylesheet
String hoverImage = "<span>"
Expand Down Expand Up @@ -315,14 +315,14 @@ private static Optional<String> packageName(TypeElement element) {
case MEMBER -> packageName((TypeElement) element.getEnclosingElement());
};
}
}

private static String packagelessCanonicalName(TypeElement element) {
String result = element.getSimpleName().toString();
while (element.getNestingKind() == NestingKind.MEMBER) {
element = (TypeElement) element.getEnclosingElement();
result = element.getSimpleName().toString() + '.' + result;
}
return result;
private static String packagelessCanonicalName(TypeElement element) {
String result = element.getSimpleName().toString();
while (element.getNestingKind() == NestingKind.MEMBER) {
element = (TypeElement) element.getEnclosingElement();
result = element.getSimpleName().toString() + '.' + result;
}
return result;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html>
<!--
Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,7 +26,6 @@
<html lang="en">
<head>
<title>Value-based Classes</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<h1 id="ValueBased">{@index "Value-based Classes"}</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html>
<!--
Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,7 +26,6 @@
<html lang="en">
<head>
<title>Java Thread Primitive Deprecation</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<h1>Java Thread Primitive Deprecation</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,19 @@ public abstract sealed class AbstractPoolEntry {
*/

private static final int TAG_SMEAR = 0x13C4B2D1;
private static final int INT_PHI = 0x9E3779B9;
static final int NON_ZERO = 0x40000000;

public static int hash1(int tag, int x1) {
return phiMix(tag * TAG_SMEAR + x1);
return (tag * TAG_SMEAR + x1) | NON_ZERO;
}

public static int hash2(int tag, int x1, int x2) {
return phiMix(tag * TAG_SMEAR + x1 + 31*x2);
return (tag * TAG_SMEAR + x1 + 31 * x2) | NON_ZERO;
}

// Ensure that hash is never zero
public static int hashString(int stringHash) {
return phiMix(stringHash | (1 << 30));
}

public static int phiMix(int x) {
int h = x * INT_PHI;
return h ^ (h >> 16);
return stringHash | NON_ZERO;
}

public static Utf8Entry rawUtf8EntryFromStandardAttributeName(String name) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -76,9 +76,7 @@ public boolean equals(Object obj) {

static int computeHashCode(MethodHandleEntryImpl handle,
List<? extends LoadableConstantEntry> arguments) {
int hash = handle.hashCode();
hash = 31 * hash + arguments.hashCode();
return AbstractPoolEntry.phiMix(hash);
return (31 * handle.hashCode() + arguments.hashCode()) | AbstractPoolEntry.NON_ZERO;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,77 +988,77 @@ public byte[] codeArray() {
public static AttributeMapper<?> standardAttribute(Utf8Entry name) {
// critical bootstrap path, so no lambdas nor method handles here
return switch (name.hashCode()) {
case 0x78147009 ->
case 0x46699ff2 ->
name.equalsString(NAME_ANNOTATION_DEFAULT) ? annotationDefault() : null;
case 0x665e3a3a ->
case 0x5208e184 ->
name.equalsString(NAME_BOOTSTRAP_METHODS) ? bootstrapMethods() : null;
case 0xcb7e162 ->
case 0xcb60907a ->
name.equalsString(NAME_CHARACTER_RANGE_TABLE) ? characterRangeTable() : null;
case 0x21e41e7e ->
case 0x4020220d ->
name.equalsString(NAME_CODE) ? code() : null;
case 0x5a306b41 ->
case 0xc20dd1fe ->
name.equalsString(NAME_COMPILATION_ID) ? compilationId() : null;
case 0x3e191c7c ->
case 0xcab1940d ->
name.equalsString(NAME_CONSTANT_VALUE) ? constantValue() : null;
case 0x5e88ed0c ->
case 0x558641d3 ->
name.equalsString(NAME_DEPRECATED) ? deprecated() : null;
case 0x7284695e ->
case 0x51d443cd ->
name.equalsString(NAME_ENCLOSING_METHOD) ? enclosingMethod() : null;
case 0x21df25db ->
case 0x687c1624 ->
name.equalsString(NAME_EXCEPTIONS) ? exceptions() : null;
case 0x11392da9 ->
case 0x7adb2910 ->
name.equalsString(NAME_INNER_CLASSES) ? innerClasses() : null;
case 0x167536fc ->
case 0x653f0551 ->
name.equalsString(NAME_LINE_NUMBER_TABLE) ? lineNumberTable() : null;
case 0x46939abc ->
case 0x64c75927 ->
name.equalsString(NAME_LOCAL_VARIABLE_TABLE) ? localVariableTable() : null;
case 0x63ee67f4 ->
case 0x6697f98d ->
name.equalsString(NAME_LOCAL_VARIABLE_TYPE_TABLE) ? localVariableTypeTable() : null;
case 0x2b597e15 ->
case 0xdbb0cdcb ->
name.equalsString(NAME_METHOD_PARAMETERS) ? methodParameters() : null;
case 0x19f20ade ->
case 0xc9b0928c ->
name.equalsString(NAME_MODULE) ? module() : null;
case 0x47f6395e ->
case 0x41cd27e8 ->
name.equalsString(NAME_MODULE_HASHES) ? moduleHashes() : null;
case 0x54db809 ->
case 0x7deb0a13 ->
name.equalsString(NAME_MODULE_MAIN_CLASS) ? moduleMainClass() : null;
case 0x1abd1c2c ->
case 0x6706ff99 ->
name.equalsString(NAME_MODULE_PACKAGES) ? modulePackages() : null;
case 0x6ba46dd ->
case 0x60272858 ->
name.equalsString(NAME_MODULE_RESOLUTION) ? moduleResolution() : null;
case 0x46f7d91d ->
case 0x5646d73d ->
name.equalsString(NAME_MODULE_TARGET) ? moduleTarget() : null;
case 0x5137f53 ->
case 0x50336c40 ->
name.equalsString(NAME_NEST_HOST) ? nestHost() : null;
case 0x4a8fa3b6 ->
case 0x4735ab81 ->
name.equalsString(NAME_NEST_MEMBERS) ? nestMembers() : null;
case 0x55c73cb6 ->
case 0x7100d9fe ->
name.equalsString(NAME_PERMITTED_SUBCLASSES) ? permittedSubclasses() : null;
case 0x3fe76d4e ->
case 0xd1ab5871 ->
name.equalsString(NAME_RECORD) ? record() : null;
case 0x180d6925 ->
case 0x7588550f ->
name.equalsString(NAME_RUNTIME_INVISIBLE_ANNOTATIONS) ? runtimeInvisibleAnnotations() : null;
case 0x7be22752 ->
case 0xcc74da30 ->
name.equalsString(NAME_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS) ? runtimeInvisibleParameterAnnotations() : null;
case 0x5299824 ->
case 0xf67697f5 ->
name.equalsString(NAME_RUNTIME_INVISIBLE_TYPE_ANNOTATIONS) ? runtimeInvisibleTypeAnnotations() : null;
case 0x3534786e ->
case 0xe0837d2a ->
name.equalsString(NAME_RUNTIME_VISIBLE_ANNOTATIONS) ? runtimeVisibleAnnotations() : null;
case 0xb4b4ac6 ->
case 0xc945a075 ->
name.equalsString(NAME_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS) ? runtimeVisibleParameterAnnotations() : null;
case 0x6926482 ->
case 0x611a3a90 ->
name.equalsString(NAME_RUNTIME_VISIBLE_TYPE_ANNOTATIONS) ? runtimeVisibleTypeAnnotations() : null;
case 0x16a42b7c ->
case 0xf76fb898 ->
name.equalsString(NAME_SIGNATURE) ? signature() : null;
case 0x400ab245 ->
case 0x6b41b047 ->
name.equalsString(NAME_SOURCE_DEBUG_EXTENSION) ? sourceDebugExtension() : null;
case 0x2af490d4 ->
case 0x748c2857 ->
name.equalsString(NAME_SOURCE_FILE) ? sourceFile() : null;
case 0x303e0c58 ->
case 0x6bf13a96 ->
name.equalsString(NAME_SOURCE_ID) ? sourceId() : null;
case 0x19c7d0cd ->
case 0xfa85ee5a ->
name.equalsString(NAME_STACK_MAP_TABLE) ? stackMapTable() : null;
case 0x3dc79b7a ->
case 0xf2670725 ->
name.equalsString(NAME_SYNTHETIC) ? synthetic() : null;
default -> null;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -287,6 +287,7 @@ ZAR=ZAR
ZMK=ZMK
ZMW=ZMW
ZWD=ZWD
ZWG=ZWG
ZWL=ZWL
ZWN=ZWN
ZWR=ZWR
Expand Down Expand Up @@ -512,5 +513,6 @@ yum=Yugoslavian New Dinar (1994-2002)
zar=South African Rand
zmk=Zambian Kwacha
zwd=Zimbabwean Dollar (1980-2008)
zwg=Zimbabwe Gold
zwl=Zimbabwean Dollar (2009)
zwr=Zimbabwean Dollar (2008)
10 changes: 5 additions & 5 deletions src/java.base/share/data/currency/CurrencyData.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -32,7 +32,7 @@ formatVersion=3
# Version of the currency code information in this class.
# It is a serial number that accompanies with each amendment.

dataVersion=176
dataVersion=177

# List of all valid ISO 4217 currency codes.
# To ensure compatibility, do not remove codes.
Expand All @@ -56,8 +56,8 @@ all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036
TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-UYI940-\
UYU858-UZS860-VEB862-VED926-VEF937-VES928-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\
XBB956-XBC957-XBD958-XCD951-XCG532-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\
XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZMW967-ZWD716-ZWL932-\
ZWN942-ZWR935
XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZMW967-ZWD716-ZWG924-\
ZWL932-ZWN942-ZWR935


# Mappings from ISO 3166 country codes to ISO 4217 currency codes.
Expand Down Expand Up @@ -582,7 +582,7 @@ YE=YER
# ZAMBIA
ZM=ZMW
# ZIMBABWE
ZW=ZWL
ZW=ZWG


# List of currencies with non-2digit decimals for minor units,
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/java/util/Currency/CheckDataVersion.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -38,7 +38,7 @@
import java.util.Currency;

class CheckDataVersion {
static final String datafile = "tablea1.txt";
static final String datafile = "ISO4217-list-one.txt";
static final String FILEVERSIONKEY = "FILEVERSION=";
static final String DATAVERSIONKEY = "DATAVERSION=";
static String fileVersion;
Expand Down
6 changes: 3 additions & 3 deletions test/jdk/java/util/Currency/CurrencyTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,7 +25,7 @@
* @test
* @bug 4290801 4692419 4693631 5101540 5104960 6296410 6336600 6371531
* 6488442 7036905 8008577 8039317 8074350 8074351 8150324 8167143
* 8264792
* 8264792 8334653
* @summary Basic tests for Currency class.
* @modules java.base/java.util:open
* jdk.localedata
Expand Down Expand Up @@ -59,7 +59,7 @@

public class CurrencyTest {

// 'tablea1.txt' should be up-to-date before testing
// 'ISO4217-list-one.txt' should be up-to-date before testing
@Test
public void dataVersionTest() {
CheckDataVersion.check();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
#
# Amendments up until ISO 4217 AMENDMENT NUMBER 176
# (As of 06 December 2023)
# Amendments up until ISO 4217 AMENDMENT NUMBER 177
# (As of 20 June 2024)
#

# Version
FILEVERSION=3
DATAVERSION=176
DATAVERSION=177

# ISO 4217 currency data
AF AFN 971 2
Expand Down Expand Up @@ -276,7 +276,7 @@ WF XPF 953 0
EH MAD 504 2
YE YER 886 2
ZM ZMW 967 2
ZW ZWL 932 2
ZW ZWG 924 2
#XAU XAU 959
#XBA XBA 955
#XBB XBB 956
Expand Down
11 changes: 6 additions & 5 deletions test/jdk/java/util/Currency/ValidateISO4217.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,7 +25,7 @@
* @test
* @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759
* 8039317 8074350 8074351 8145952 8187946 8193552 8202026 8204269
* 8208746 8209775 8264792 8274658 8283277 8296239 8321480
* 8208746 8209775 8264792 8274658 8283277 8296239 8321480 8334653
* @summary Validate ISO 4217 data for Currency class.
* @modules java.base/java.util:open
* jdk.localedata
Expand Down Expand Up @@ -60,15 +60,16 @@

/**
* This class tests the latest ISO 4217 data and Java's currency data which is
* based on ISO 4217. The golden-data file (ISO 4217 data) 'tablea1.txt' has the following
* based on ISO 4217. The golden-data file, 'ISO4217-list-one.txt', based on the
* “List one: Currency, fund and precious metal codes” has the following
* format: <Country code>\t<Currency code>\t<Numeric code>\t<Minor unit>[\t<Cutover Date>\t<new Currency code>\t<new Numeric code>\t<new Minor unit>]
* The Cutover Date is given in SimpleDateFormat's 'yyyy-MM-dd-HH-mm-ss' format in the GMT time zone.
*/
public class ValidateISO4217 {

// Input golden-data file
private static final File dataFile = new File(System.getProperty(
"test.src", "."), "tablea1.txt");
"test.src", "."), "ISO4217-list-one.txt");
// Code statuses
private static final byte UNDEFINED = 0;
private static final byte DEFINED = 1;
Expand All @@ -89,7 +90,7 @@ public class ValidateISO4217 {
+ "DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-HRK-IEP-ITL-LTL-LUF-LVL-MGF-MRO-MTL-MXV-MZM-NLG-"
+ "PTE-ROL-RUR-SDD-SIT-SLL-SKK-SRG-STD-TMM-TPE-TRL-VEF-UYI-USN-USS-VEB-VED-"
+ "XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-"
+ "YUM-ZMK-ZWD-ZWN-ZWR";
+ "YUM-ZMK-ZWD-ZWL-ZWN-ZWR";
private static final String[][] extraCodes = {
/* Defined in ISO 4217 list, but don't have code and minor unit info. */
{"AQ", "", "", "0"}, // Antarctica
Expand Down
Loading

0 comments on commit a6736bd

Please sign in to comment.