jets3t
jets3t copied to clipboard
StorageObject#toString throws for pre-upload objects
When creating a new object to pass to putObject, the object has no metadata for the date. However, calling toString() invokes getLastModifiedDate(), which invokes getDate(), which throws IllegalArgumentException (which should really be IllegalStateException) if no date is set. This means that trying to log an object pre-upload causes an exception.
Since toString() should never throw an exception, it should either omit lastModified or inspect it in a null-safe manner.