Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
import java.util.ServiceLoader;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import sun.util.logging.PlatformLogger;

Expand All @@ -125,6 +127,7 @@
*
* @since 1.8
*/
@NullMarked
public abstract class AbstractChronology implements Chronology {

/**
Expand Down Expand Up @@ -417,7 +420,7 @@ protected AbstractChronology() {
* because of a conflict in the input data
*/
@Override
public ChronoLocalDate resolveDate(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) {
public @Nullable ChronoLocalDate resolveDate(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) {
// check epoch-day before inventing era
if (fieldValues.containsKey(EPOCH_DAY)) {
return dateEpochDay(fieldValues.remove(EPOCH_DAY));
Expand Down Expand Up @@ -678,8 +681,6 @@ public int compareTo(Chronology other) {
* @return true if this is equal to the other chronology
*/
@Override


public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
Expand Down
9 changes: 6 additions & 3 deletions src/java.base/share/classes/java/time/chrono/Chronology.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import org.jspecify.annotations.NullMarked;
Comment thread
cpovirk marked this conversation as resolved.
import org.jspecify.annotations.Nullable;

/**
* A calendar system, used to organize and identify dates.
Expand Down Expand Up @@ -161,6 +163,7 @@
*
* @since 1.8
*/
@NullMarked
public interface Chronology extends Comparable<Chronology> {

/**
Expand Down Expand Up @@ -295,7 +298,7 @@ static Set<Chronology> getAvailableChronologies() {
* @return the calendar system type, null if the calendar is not defined by CLDR/LDML
* @see #getId()
*/
String getCalendarType();
@Nullable String getCalendarType();

//-----------------------------------------------------------------------
/**
Expand Down Expand Up @@ -684,7 +687,7 @@ public <R> R query(TemporalQuery<R> query) {
* @throws DateTimeException if the date cannot be resolved, typically
* because of a conflict in the input data
*/
ChronoLocalDate resolveDate(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle);
@Nullable ChronoLocalDate resolveDate(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle);

//-----------------------------------------------------------------------
/**
Expand Down Expand Up @@ -823,7 +826,7 @@ default boolean isIsoBased() {
* @return true if this is equal to the other chronology
*/
@Override
boolean equals(Object obj);
boolean equals(@Nullable Object obj);

/**
* A hash code for this chronology.
Expand Down
Loading