googleapis / googleapis/google-http-java-client

Add java.time.Duration-based APIs

Đang mở
#776 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
semver: minor status: blocked type: cleanup
Ngôn ngữ chính
Java
Star
1.4k
Fork
473
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Representing date/time concepts as numeric primitives is a bad idea. It leads to unit mismatch, overflows, and many other dangerous date/time-related bugs.

For instance, it's impossible to tell what time unit `readTimeout` is without reading it's javadocs:
```java
public final class HttpRequest {
public HttpRequest setReadTimeout(int readTimeout) { ... }
}
```

Please consider adding `java.time.Duration` overloads to all APIs that accept a date/time concept as a numeric primitive. Methods that _return_ a numeric primitive representing a date/time concept are much more difficult as new, alternative method names must be chosen (e.g., `public int getReadTimeout()`).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.