Closed
Description
Description
Could we maybe have get(int) in our arguments with @NotNull and as replacement Optional getOptional(int)? In most cases the argument can't be null and if its supposed to potentially be, one could use the optional getter. An exception could be thrown in the get method if the object is expected to be notnull but is null
Expected code
Before:
@Nullable Object get(int index);
After:
@NotNull Object get(int index);
Optional<Object> getOptional(int index);
Extra details
No response