Description
The org.apache.sis.storage.DataSet interface contains the following method:
Envelope getEnvelope() throws DataStoreException;
It should be:
Optional<Envelope> getEnvelope() throws DataStoreException;
The javadoc was saying that this envelope should not be null, but may nevertheless be null is some circumstances. For example the envelope may be too costly to compute if it would require to scan all features in a dataset. The danger is that users will assume that the envelope will never be null for practical purposes, which is a dangerous assumptions. In another project using SIS, we found that this assumption was one significant cause of NullPointerException. We propose to declare the envelope as Optional for making clear that it may be absent.
Note that this is an incompatible API changes. We hope that DataSet.getEnvelope() is not yet used too widely.