-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Several retrieval APIs are inconsistent with regard to the nullability semantics of return values. Some of them use exceptions to signal the absence of an element (such as JobRegistry#getJob(String name) throws NoSuchJobException
, while other return null
(like JobRepository#getJobInstance(Long instanceId)
).
Moreover, there are several implementations that do no adhere to the contract they implement. For example, org.springframework.batch.core.step.StepLocator#getStep(String stepName) throws NoSuchStepException
clearly states that implementations must throw a NoSuchStepException
when a step is not found, yet SimpleJob
might return null.
With the introduction of jSpecify, we need to review all public APIs and revisit their implementations towards a consistent approach of handling return values.