gravitino
gravitino copied to clipboard
[Improvement] Prevent potential null pointer error in MetadataObjectStatisticsOperations.java
What would you like to be improved?
Added validate to MetadataObjectStatisticsOperations.java dropStatistics method to throw a clear error when the caller supplies a null or empty statistics list, preventing a NullPointerExceptions.
Adding a few lines to the existing test shows the issue:
private void testDropStatistics(SupportsStatistics supportsStatistics, String path)
throws JsonProcessingException {
Assertions.assertThrows(
IllegalArgumentException.class, () -> supportsStatistics.dropStatistics(null));
Assertions.assertThrows(
IllegalArgumentException.class, () -> supportsStatistics.dropStatistics(Collections.emptyList()));
How should we improve?
see above
Hi! @justinmclean Can I take this issue?
Sure it's all yours. If you have any questions, just ask.