Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public class CLDRConverter {
static final String EXEMPLAR_CITY_PREFIX = "timezone.excity.";
static final String ZONE_NAME_PREFIX = "timezone.displayname.";
static final String METAZONE_ID_PREFIX = "metazone.id.";
static final String METAZONE_DSTOFFSET_PREFIX = "metazone.dstoffset.";
static final String PARENT_LOCALE_PREFIX = "parentLocale.";
static final String META_EMPTY_ZONE_NAME = "EMPTY_ZONE";
static final String[] EMPTY_ZONE = {"", "", "", "", "", ""};
Expand Down Expand Up @@ -122,6 +123,11 @@ public class CLDRConverter {
static Map<String, String> pluralRules;
static Map<String, String> dayPeriodRules;

// Map of explicit dst offsets for metazones
// key: time zone ID
// value: explicit dstOffset for the corresponding metazone name
static final Map<String, String> explicitDstOffsets = HashMap.newHashMap(32);

static enum DraftType {
UNCONFIRMED,
PROVISIONAL,
Expand Down Expand Up @@ -772,6 +778,12 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
names.putAll(exCities);

// Explicit metazone offsets
if (id.equals("root")) {
explicitDstOffsets.forEach((k, v) ->
names.put(METAZONE_DSTOFFSET_PREFIX + k, v));
}

// If there's no UTC entry at this point, add an empty one
if (!names.isEmpty() && !names.containsKey("UTC")) {
names.putIfAbsent(METAZONE_ID_PREFIX + META_EMPTY_ZONE_NAME, EMPTY_ZONE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2026, 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 @@ -84,7 +84,15 @@ public void startElement(String uri, String localName, String qName, Attributes

if (fromLDT.isBefore(now) && toLDT.isAfter(now)) {
metazone = attributes.getValue("mzone");

// Explicit metazone DST offsets. Only the "dst" offset is needed,
// as "std" is used by default when it doesn't match.
String dstOffset = attributes.getValue("dstOffset");
if (dstOffset != null) {
CLDRConverter.explicitDstOffsets.put(tzid, dstOffset);
}
}

pushIgnoredContainer(qName);
break;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2026, 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 @@ -197,7 +197,8 @@ public void generateBundle(String packageName, String baseName, String localeID,
} else if (value instanceof String) {
String valStr = (String)value;
if (type == BundleType.TIMEZONE &&
!key.startsWith(CLDRConverter.EXEMPLAR_CITY_PREFIX) ||
!(key.startsWith(CLDRConverter.EXEMPLAR_CITY_PREFIX) ||
key.startsWith(CLDRConverter.METAZONE_DSTOFFSET_PREFIX)) ||
valStr.startsWith(META_VALUE_PREFIX)) {
out.printf(" { \"%s\", %s },\n", key, CLDRConverter.saveConvert(valStr, useJava));
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11138,6 +11138,7 @@ class StubGenerator: public StubCodeGenerator {

#endif // LINUX

#ifdef COMPILER2
if (UseSecondarySupersTable) {
StubRoutines::_lookup_secondary_supers_table_slow_path_stub = generate_lookup_secondary_supers_table_slow_path_stub();
if (! InlineSecondarySupersTest) {
Expand All @@ -11147,6 +11148,7 @@ class StubGenerator: public StubCodeGenerator {
}
}
}
#endif

StubRoutines::aarch64::set_completed(); // Inidicate that arraycopy and zero_blocks stubs are generated
}
Expand Down
27 changes: 17 additions & 10 deletions src/java.base/share/classes/java/text/SimpleDateFormat.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2026, 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 @@ -41,7 +41,7 @@
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import static java.text.DateFormatSymbols.*;
import java.time.ZoneOffset;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
Expand All @@ -57,6 +57,8 @@
import sun.util.locale.provider.LocaleProviderAdapter;
import sun.util.locale.provider.TimeZoneNameUtility;

import static java.text.DateFormatSymbols.*;

/**
* {@code SimpleDateFormat} is a concrete class for formatting and
* parsing dates in a locale-sensitive manner. It allows for formatting
Expand Down Expand Up @@ -1283,15 +1285,22 @@ private void subFormat(int patternCharIndex, int count,

case PATTERN_ZONE_NAME: // 'z'
if (current == null) {
TimeZone tz = calendar.getTimeZone();
String tzid = tz.getID();
int zoneOffset = calendar.get(Calendar.ZONE_OFFSET);
int dstOffset = calendar.get(Calendar.DST_OFFSET) + zoneOffset;

// Check if an explicit metazone DST offset exists
String explicitDstOffset = TimeZoneNameUtility.explicitDstOffset(tzid);
boolean daylight = explicitDstOffset != null ?
dstOffset == ZoneOffset.of(explicitDstOffset).getTotalSeconds() * 1_000 :
dstOffset != zoneOffset;
if (formatData.locale == null || formatData.isZoneStringsSet) {
int zoneIndex =
formatData.getZoneIndex(calendar.getTimeZone().getID());
int zoneIndex = formatData.getZoneIndex(tzid);
if (zoneIndex == -1) {
value = calendar.get(Calendar.ZONE_OFFSET) +
calendar.get(Calendar.DST_OFFSET);
buffer.append(ZoneInfoFile.toCustomID(value));
buffer.append(ZoneInfoFile.toCustomID(dstOffset));
} else {
int index = (calendar.get(Calendar.DST_OFFSET) == 0) ? 1: 3;
int index = daylight ? 3 : 1;
if (count < 4) {
// Use the short name
index++;
Expand All @@ -1300,8 +1309,6 @@ private void subFormat(int patternCharIndex, int count,
buffer.append(zoneStrings[zoneIndex][index]);
}
} else {
TimeZone tz = calendar.getTimeZone();
boolean daylight = (calendar.get(Calendar.DST_OFFSET) != 0);
int tzstyle = (count < 4 ? TimeZone.SHORT : TimeZone.LONG);
buffer.append(tz.getDisplayName(daylight, tzstyle, formatData.locale));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2026, 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 @@ -4503,7 +4503,11 @@ public boolean format(DateTimePrintContext context, StringBuilder buf) {
TemporalAccessor dt = context.getTemporal();
int type = GENERIC;
if (!isGeneric) {
if (dt.isSupported(ChronoField.INSTANT_SECONDS)) {
// Check if an explicit metazone DST offset exists
String dstOffset = TimeZoneNameUtility.explicitDstOffset(zname);
if (dt.isSupported(OFFSET_SECONDS) && dstOffset != null) {
type = ZoneOffset.from(dt).equals(ZoneOffset.of(dstOffset)) ? DST : STD;
} else if (dt.isSupported(ChronoField.INSTANT_SECONDS)) {
type = zone.getRules().isDaylightSavings(Instant.from(dt)) ? DST : STD;
} else if (dt.isSupported(ChronoField.EPOCH_DAY) &&
dt.isSupported(ChronoField.NANO_OF_DAY)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public class LocaleResources {
// TimeZoneNamesBundle exemplar city prefix
private static final String TZNB_EXCITY_PREFIX = "timezone.excity.";

// TimeZoneNamesBundle explicit metazone dst offset prefix
private static final String TZNB_METAZONE_DSTOFFSET_PREFIX = "metazone.dstoffset.";

// null singleton cache value
private static final Object NULLOBJECT = new Object();

Expand Down Expand Up @@ -321,7 +324,8 @@ public Object getTimeZoneNames(String key) {

if (Objects.isNull(data) || Objects.isNull(val = data.get())) {
TimeZoneNamesBundle tznb = localeData.getTimeZoneNames(locale);
if (key.startsWith(TZNB_EXCITY_PREFIX)) {
if (key.startsWith(TZNB_EXCITY_PREFIX) ||
key.startsWith(TZNB_METAZONE_DSTOFFSET_PREFIX)) {
if (tznb.containsKey(key)) {
val = tznb.getString(key);
assert val instanceof String;
Expand Down Expand Up @@ -378,7 +382,8 @@ String[][] getZoneStrings() {
Set<String[]> value = new LinkedHashSet<>();
Set<String> tzIds = new HashSet<>(Arrays.asList(TimeZone.getAvailableIDs()));
for (String key : keyset) {
if (!key.startsWith(TZNB_EXCITY_PREFIX)) {
if (!key.startsWith(TZNB_EXCITY_PREFIX) &&
!key.startsWith(TZNB_METAZONE_DSTOFFSET_PREFIX)) {
value.add(rb.getStringArray(key));
tzIds.remove(key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.util.spi.TimeZoneNameProvider;
import sun.util.calendar.ZoneInfo;
import sun.util.cldr.CLDRLocaleProviderAdapter;
import static sun.util.locale.provider.LocaleProviderAdapter.Type;
import static sun.util.locale.provider.LocaleProviderAdapter.Type.CLDR;

/**
* Utility class that deals with the localized time zone names
Expand Down Expand Up @@ -169,10 +169,22 @@ public static Optional<String> convertLDMLShortID(String shortID) {
* Returns the canonical ID for the given ID
*/
public static Optional<String> canonicalTZID(String id) {
return ((CLDRLocaleProviderAdapter)LocaleProviderAdapter.forType(Type.CLDR))
return ((CLDRLocaleProviderAdapter)LocaleProviderAdapter.forType(CLDR))
.canonicalTZID(id);
}

/**
* {@return the explicit metazone DST offset for the specified time zone ID, if exists}
* @param tzid the time zone ID
*/
public static String explicitDstOffset(String tzid) {
return (String) (LocaleProviderAdapter.forType(CLDR) instanceof CLDRLocaleProviderAdapter ca ?
ca.getLocaleResources(Locale.ROOT)
.getTimeZoneNames("metazone.dstoffset." +
ca.canonicalTZID(tzid).orElse(tzid)) :
null);
}

private static String[] retrieveDisplayNamesImpl(String id, Locale locale) {
LocaleServiceProviderPool pool =
LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2026, 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 @@ -43,8 +43,6 @@
import java.util.Map;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.MissingResourceException;
import java.util.Objects;
import java.util.Set;

/**
Expand Down
28 changes: 0 additions & 28 deletions src/java.base/share/data/cacerts/luxtrustglobalrootca

This file was deleted.

14 changes: 7 additions & 7 deletions src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2026, 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 @@ -1202,7 +1202,7 @@ private void endRead() {

private volatile boolean isOpen = true;
private final SeekableByteChannel ch; // channel to the zipfile
final byte[] cen; // CEN & ENDHDR
final byte[] cen; // CEN
private END end;
private long locpos; // position of first LOC header (usually 0)

Expand Down Expand Up @@ -1566,15 +1566,15 @@ private byte[] initCEN() throws IOException {
if (locpos < 0)
throw new ZipException("invalid END header (bad central directory offset)");

// read in the CEN and END
byte[] cen = new byte[(int)(end.cenlen + ENDHDR)];
if (readNBytesAt(cen, 0, cen.length, cenpos) != end.cenlen + ENDHDR) {
// read in the CEN
byte[] cen = new byte[(int)(end.cenlen)];
if (readNBytesAt(cen, 0, cen.length, cenpos) != end.cenlen) {
throw new ZipException("read CEN tables failed");
}
// Iterate through the entries in the central directory
inodes = LinkedHashMap.newLinkedHashMap(end.centot + 1);
int pos = 0;
int limit = cen.length - ENDHDR;
int limit = cen.length;
while (pos < limit) {
if (!cenSigAt(cen, pos))
throw new ZipException("invalid CEN header (bad signature)");
Expand Down Expand Up @@ -1606,7 +1606,7 @@ private byte[] initCEN() throws IOException {
// skip ext and comment
pos += (CENHDR + nlen + elen + clen);
}
if (pos + ENDHDR != cen.length) {
if (pos != cen.length) {
throw new ZipException("invalid CEN header (bad header size)");
}
buildNodeTree();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ public void setupGUI() {

public void test() throws AWTException, InterruptedException,
InvocationTargetException {
EventQueue.invokeAndWait(() -> {
onScreen = text_field.getLocationOnScreen();
size = text_field.getSize();
});
Robot robot = new Robot();
robot.setAutoDelay(50);
robot.delay(1000);

EventQueue.invokeAndWait(() -> {
onScreen = text_field.getLocationOnScreen();
size = text_field.getSize();
});

int y = onScreen.y + (size.height / 2);
robot.mouseMove(onScreen.x + (size.width / 2), y);
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
Expand Down
10 changes: 3 additions & 7 deletions test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320
* 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654
* 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 8319187
* 8321408 8316138 8341057 8303770 8350498 8359170 8361212 8372351
* 8321408 8316138 8341057 8303770 8350498 8359170 8361212 8372351 8387123
* @summary Check root CA entries in cacerts file
*/
import java.io.ByteArrayInputStream;
Expand All @@ -48,13 +48,13 @@ public class VerifyCACerts {

// The numbers of certs now.
// SapMachine 2021-09-23: Additional certificate for SAP
private static final int COUNT = 112;
private static final int COUNT = 111;

// SHA-256 of cacerts, can be generated with
// shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95
// SapMachine 2021-09-23: Additional certificate for SAP
private static final String CHECKSUM
= "46:B4:9E:42:70:3A:8A:AA:28:88:21:EE:DA:1B:4A:9B:6F:0C:C6:5F:D4:58:31:F7:A5:DB:9E:1B:5E:43:A8:9D";
= "A6:7C:8E:66:E1:30:1E:DB:A0:AF:2A:1E:63:44:EB:D3:E5:B5:4A:75:F8:AE:A2:85:3A:1F:20:09:E4:A5:D7:33";

// Hex formatter to upper case with ":" delimiter
private static final HexFormat HEX = HexFormat.ofDelimiter(":").withUpperCase();
Expand Down Expand Up @@ -147,8 +147,6 @@ public class VerifyCACerts {
"96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6");
put("letsencryptisrgx2 [jdk]",
"69:72:9B:8E:15:A8:6E:FC:17:7A:57:AF:B7:17:1D:FC:64:AD:D2:8C:2F:CA:8C:F1:50:7E:34:45:3C:CB:14:70");
put("luxtrustglobalrootca [jdk]",
"A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50");
put("quovadisrootca [jdk]",
"A4:5E:DE:3B:BB:F0:9C:8A:E1:5C:72:EF:C0:72:68:D6:93:A2:1C:99:6F:D5:1E:67:CA:07:94:60:FD:6D:88:73");
put("quovadisrootca1g3 [jdk]",
Expand Down Expand Up @@ -300,8 +298,6 @@ public class VerifyCACerts {
add("addtrustexternalca [jdk]");
// Valid until: Sat May 30 10:44:50 GMT 2020
add("addtrustqualifiedca [jdk]");
// Valid until: Wed Mar 17 02:51:37 PDT 2021
add("luxtrustglobalrootca [jdk]");
// Valid until: Wed Mar 17 11:33:33 PDT 2021
add("quovadisrootca [jdk]");
// Valid until: Sat May 21 04:00:00 GMT 2022
Expand Down
Loading