79729989

Date: 2025-08-08 15:58:51
Score: 1
Natty:
Report link

Span creation for metrics and monitoring and thread locals are common case of wanting an unnamed resource, where instead the Java compiler could create a name behind the scenes on which it would call the close for the AutoCloseable.

try(createSpan()) {
 // actions in the monitored span
} // span is complete

The _ usage is a little better, but still unnecessarily verbose.

Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Brian Sullivan