Skip to content

Commit

Permalink
Add section to coding guidelines on Optional usage (open-telemetry#6894)
Browse files Browse the repository at this point in the history
This was discussed a long while back, but never documented (and recently
came up in open-telemetry#6889)

Co-authored-by: Fabrizio Ferri-Benedetti <[email protected]>
  • Loading branch information
2 people authored and LironKS committed Oct 31, 2022
1 parent 880e41c commit 2880af3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/contributing/style-guideline.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,11 @@ plugins {
id("otel.nullaway-conventions")
}
```

## java.util.Optional usage

Following the reasoning from [Writing a Java library with better experience (slide 12)](https://speakerdeck.com/trustin/writing-a-java-library-with-better-experience?slide=12),
usage of `java.util.Optional` is kept at a minimum in this project.

It is ok to use `Optional` in places where it does not leak into public API signatures and where
performance is not critical.

0 comments on commit 2880af3

Please sign in to comment.