googleapis / googleapis/google-http-java-client

Add java.time.Duration-based APIs

未关闭
#776 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
semver: minor status: blocked type: cleanup
主要语言
Java
星标
1.4k
派生
473
PR 合并指标
30 天内没有已合并 PR

描述

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()`).

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。