ConfigProperties Javadoc does not match getDuration and getMap behavior

Đã đóng Phù hợp với người mới
#8,898 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Một pull request liên quan đã được merge.

  • #1 của @thekarthikh — đã đóng, không merge
  • #8899 của @thswlsqls — đã merge
  • #8901 của @thekarthikh — đã đóng, không merge

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
94/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu trong sdk-extensions/autoconfigure-spi tại ConfigProperties.java và xem lại Javadoc cho ba phương thức được nêu tên. So sánh hành vi được mô tả với DefaultConfigProperties.getDuration và các assertion trong ConfigPropertiesTest. Hoàn thành khi Javadoc mô tả chính xác các lỗi, các đơn vị được hỗ trợ và các giá trị trả về mà không thay đổi hành vi hoặc chữ ký.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Is your feature request related to a problem? Please describe.
The Javadoc of the stable ConfigProperties SPI does not match how the default implementation behaves:

  • getDuration(String) says it returns null if the property "has a wrong type". Its own @throws says malformed values throw, and DefaultConfigProperties.getDuration throws ConfigurationException for a bad number or unit (asserted in ConfigPropertiesTest). A custom implementation that follows the first sentence would silently fall back to defaults.
  • The getDuration(String) unit list omits ns and us, which DefaultConfigProperties accepts.
  • The @return of getDuration(String, Duration) and getMap(String, Map) says "a Double-valued configuration property", copied from getDouble(String, double).

Describe the solution you'd like
Correct the three points above in ConfigProperties.java. Javadoc only; no behavior or signature change.

Describe alternatives you've considered
N/A

Spec alignment
N/A — Java SPI documentation only.

Additional context

  • Affected module: :sdk-extensions:autoconfigure-spi
  • Artifact stability: stable
  • Backward compatible: yes
Ngôn ngữ chính
Java
Star
2.5k
Fork
1k
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
52

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của open-telemetry/opentelemetry-java

Tất cả issue của open-telemetry/opentelemetry-java

Issue tương tự

Thêm issue về Java

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.