Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 java.base.jmod - Base Module
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module.
JDK 17 Base module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.base.jmod.
JDK 17 Base module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Base module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.base.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ java/time/ZoneRegion.java
/* * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ /* * Copyright (c) 2007-2012, Stephen Colebourne & Michael Nascimento Santos * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of JSR-310 nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package java.time; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectInputStream; import java.io.Serializable; import java.time.zone.ZoneRules; import java.time.zone.ZoneRulesException; import java.time.zone.ZoneRulesProvider; import java.util.Objects; /** * A geographical region where the same time-zone rules apply. * <p> * Time-zone information is categorized as a set of rules defining when and * how the offset from UTC/Greenwich changes. These rules are accessed using * identifiers based on geographical regions, such as countries or states. * The most common region classification is the Time Zone Database (TZDB), * which defines regions such as 'Europe/Paris' and 'Asia/Tokyo'. * <p> * The region identifier, modeled by this class, is distinct from the * underlying rules, modeled by {@link ZoneRules}. * The rules are defined by governments and change frequently. * By contrast, the region identifier is well-defined and long-lived. * This separation also allows rules to be shared between regions if appropriate. * * @implSpec * This class is immutable and thread-safe. * * @since 1.8 */ final class ZoneRegion extends ZoneId implements Serializable { /** * Serialization version. */ @java.io.Serial private static final long serialVersionUID = 8386373296231747096L; /** * The time-zone ID, not null. */ private final String id; /** * The time-zone rules, null if zone ID was loaded leniently. */ private final transient ZoneRules rules; /** * Obtains an instance of {@code ZoneId} from an identifier. * * @param zoneId the time-zone ID, not null * @param checkAvailable whether to check if the zone ID is available * @return the zone ID, not null * @throws DateTimeException if the ID format is invalid * @throws ZoneRulesException if checking availability and the ID cannot be found */ static ZoneRegion ofId(String zoneId, boolean checkAvailable) { Objects.requireNonNull(zoneId, "zoneId"); checkName(zoneId); ZoneRules rules = null; try { // always attempt load for better behavior after deserialization rules = ZoneRulesProvider.getRules(zoneId, true); } catch (ZoneRulesException ex) { if (checkAvailable) { throw ex; } } return new ZoneRegion(zoneId, rules); } /** * Checks that the given string is a legal ZondId name. * * @param zoneId the time-zone ID, not null * @throws DateTimeException if the ID format is invalid */ private static void checkName(String zoneId) { int n = zoneId.length(); if (n < 2) { throw new DateTimeException("Invalid ID for region-based ZoneId, invalid format: " + zoneId); } for (int i = 0; i < n; i++) { char c = zoneId.charAt(i); if (c >= 'a' && c <= 'z') continue; if (c >= 'A' && c <= 'Z') continue; if (c == '/' && i != 0) continue; if (c >= '0' && c <= '9' && i != 0) continue; if (c == '~' && i != 0) continue; if (c == '.' && i != 0) continue; if (c == '_' && i != 0) continue; if (c == '+' && i != 0) continue; if (c == '-' && i != 0) continue; throw new DateTimeException("Invalid ID for region-based ZoneId, invalid format: " + zoneId); } } //------------------------------------------------------------------------- /** * Constructor. * * @param id the time-zone ID, not null * @param rules the rules, null for lazy lookup */ ZoneRegion(String id, ZoneRules rules) { this.id = id; this.rules = rules; } //----------------------------------------------------------------------- @Override public String getId() { return id; } @Override public ZoneRules getRules() { // additional query for group provider when null allows for possibility // that the provider was updated after the ZoneId was created return (rules != null ? rules : ZoneRulesProvider.getRules(id, false)); } //----------------------------------------------------------------------- /** * Writes the object using a * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>. * @serialData * <pre> * out.writeByte(7); // identifies a ZoneId (not ZoneOffset) * out.writeUTF(zoneId); * </pre> * * @return the instance of {@code Ser}, not null */ @java.io.Serial private Object writeReplace() { return new Ser(Ser.ZONE_REGION_TYPE, this); } /** * Defend against malicious streams. * * @param s the stream to read * @throws InvalidObjectException always */ @java.io.Serial private void readObject(ObjectInputStream s) throws InvalidObjectException { throw new InvalidObjectException("Deserialization via serialization delegate"); } @Override void write(DataOutput out) throws IOException { out.writeByte(Ser.ZONE_REGION_TYPE); writeExternal(out); } void writeExternal(DataOutput out) throws IOException { out.writeUTF(id); } static ZoneId readExternal(DataInput in) throws IOException { String id = in.readUTF(); return ZoneId.of(id, false); } }
⏎ java/time/ZoneRegion.java
Or download all of them as a single archive file:
File name: java.base-17.0.5-src.zip File size: 8883851 bytes Release date: 2022-09-13 Download
2023-09-26, 68925👍, 1💬
Popular Posts:
JDK 11 java.naming.jmod is the JMOD file for JDK 11 Naming module. JDK 11 Naming module compiled cla...
How to merge two JAR files with "jar" commands? I am tired of specifying multiple JAR files in the c...
JDK 11 java.compiler.jmod is the JMOD file for JDK 11 Compiler module. JDK 11 Compiler module compil...
Saxon-HE (home edition) is an open source product available under the Mozilla Public License. It pro...
How to perform XML Schema validation with sax\Writer.java provided in the Apache Xerces package? You...