Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ExecutionContextDao API Clarification [BATCH-1858] #1731
What should the behavior be here?
assertTrue(jobExecution.getExecutionContext() != null);
As of now, it will return non-null.
I'm aware that jobExecutions should never have a null execution context, and hence the trivial priority on this. We should probably be intentional about what we want to do here. I'd be inclined to either throw an exception if we are told to update the execution context with a null execution context on the assumption that something has gone horribly awry, or to allow it to be updated to null on the assumption that the user should know what they're doing.
Dave Syer commented
Agree that it should never be null. We can throw an exception in the setter, but it does seem trivial, and there are plenty of other places where null checks are not done to reduce the volume of code where the probability of it happening is low.