<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
  #pfptBannerfcspkac { all: revert !important; display: block !important;
    visibility: visible !important; opacity: 1 !important;
    background-color: #60beeb !important;
    max-width: none !important; max-height: none !important }
  .pfptPrimaryButtonfcspkac:hover, .pfptPrimaryButtonfcspkac:focus {
    background-color: #77a8c4 !important; }
  .pfptPrimaryButtonfcspkac:active {
    background-color: #8193a0 !important; }
  html:root, html:root>body { all: revert !important; display: block !important;
    visibility: visible !important; opacity: 1 !important; }
</style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">
That's totally fair and what I expected. Maybe the if(x. isBound()) return x. get() could be made more performant, and I suppose somewhere the docs could mention using a NullObject pattern is a useful approach. -Michael Sent from Mailspring, the</div>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>

<!--[if ((ie)|(mso))]>
  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 0px 0px 10px 0px; direction: ltr" lang="en"><tr><td>
    <table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 6px 8px; width: 100%; border-radius:4px; border-top:4px solid #8193a0;background-color:#60beeb;"><tr><td valign="top">
      <table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 4px 8px; font-size: 12px; line-height: 16px">
        <tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; line-height: 20px; direction: ltr">
          This Message Is From an Untrusted Sender
        </td></tr>
        <tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
          You have not previously corresponded with this sender.
        </td></tr>

      </table>
      <![if ie]><br clear="all"><![endif]>
      <table align="right" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 0px 4px 0px; font-size: 14px; line-height: 36px"><tr>
        <td style="direction: ltr">  <a target="_blank" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!NR20FgduFObuVfPuGfP6mCIcSCYTnkHBALxqpod8MCn_DLXqx1oeS7WtUt1WhUaWmeF8wjplAGxQaOG4ieEMvAzpI60-0u0PRd1kN6fSxdfFJA$" style="mso-padding-alt: 7px; padding: 7px; border-radius: 2px; border: 1px solid #666666; "><strong style="font-weight: normal; color: #000000; text-decoration: none; font-family: 'Arial', sans-serif; font-size: 14px;">  Report Suspicious  </strong></a>  ‌ </td>
      </tr></table>
    </td></tr></table>
  </td></tr></table>
<![endif]-->

<![if !((ie)|(mso))]>
  <div dir="ltr" lang="en" id="pfptBannerfcspkac" style="all: revert !important; display:block !important; text-align: left !important; margin: 0 0 10px 0 !important; padding:7px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #60beeb !important; background-color: #60beeb; border-top: 4px solid #8193a0 !important; border-top: 4px solid #8193a0;">
    <div id="pfptBannerfcspkac" style="all: unset !important; float:left !important; display:block !important; margin: 1px 0 1px 0 !important; max-width: 600px !important;">
      <div id="pfptBannerfcspkac" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:1.29 !important; line-height:1.29">
        This Message Is From an Untrusted Sender
      </div>
      <div id="pfptBannerfcspkac" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:1.5 !important; line-height:1.5; margin-top:2px !important;">
You have not previously corresponded with this sender.
      </div>

    </div>
    <div id="pfptBannerfcspkac" style="all: unset !important; float: right !important; display: block !important; display: block; margin-left: 16px !important; margin-top: 1px !important; text-align: right !important; width: fit-content !important; font-size: 12px !important">
<a id="pfptBannerfcspkac" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!NR20FgduFObuVfPuGfP6mCIcSCYTnkHBALxqpod8MCn_DLXqx1oeS7WtUt1WhUaWmeF8wjplAGxQaOG4ieEMvAzpI60-0u0PRd1kN6fSxdfFJA$"
    style="all: unset !important; display: inline-block !important; text-decoration: none">
    <div class="pfptPrimaryButtonfcspkac" style="display: inline-block !important; display: inline-block; visibility: visible !important; opacity: 1 !important; color: #000000 !important; color: #000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size: 14px !important;  font-weight: normal !important; text-decoration: none !important; border-radius: 2px !important; margin-top: 3px !important; margin-bottom: 3px !important; margin-left: 16px !important; padding: 7.5px 16px !important; white-space: nowrap !important; width: fit-content !important;
        border: 1px solid #666666">
        Report Suspicious
    </div>
</a>
    </div>
    <div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
  </div>
<![endif]>

<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->
<div>That's totally fair and what I expected.  </div><br><div>Maybe the if(x.isBound()) return x.get() could be made more performant, and I suppose somewhere the docs could mention using a NullObject pattern is a useful approach.</div><br><div>-Michael</div><br><div><signature id="initial"><div><div>Sent from <a href="https://link.getmailspring.com/link/B0C6DE23-FA2B-4B0A-A181-FFBD8DD5AAED@getmailspring.com/0?redirect=https%3A%2F%2Fgetmailspring.com%2F&recipient=bG9vbS1kZXZAb3Blbmpkay5vcmc%3D">Mailspring</a>, the best free email app for work</div></div></signature></div><div class="gmail_quote_attribution">On Feb 23 2026, at 9:49 am, Alan Bateman <alan.bateman@oracle.com> wrote:</div><blockquote spellcheck="false"><div><br><br><div>On 23/02/2026 14:18, Michael Stover wrote:</div><div>> I've been using Scoped Values heavily for some time for a variety of</div><div>> things and just thought I'd share a couple thoughts .  I'm currently</div><div>> using JDK 25.</div><div>></div><div>> First, really simply, the ScopedValue.get() method throws a runtime</div><div>> exception if the value is not bound.  Ok, kind of like Optional.  But,</div><div>> it seems ScopedValue.orElse(null) also throws a runtime exception,</div><div>> which makes it awkward to safely get the currently scoped value or</div><div>> null.  Instead we have to do:</div><div>></div><div>> if(scopedValue.isBound()) return scopedValue.get();</div><div>> else return null;</div><div>></div><div>> Or use a static NullObject pattern.  If we give orElse() a new Object,</div><div>> we're creating that new object every time regardless of whether  it's</div><div>> needed.  So, calling isBound() all the time seems overly verbose and</div><div>> tedious, and it appears to be a bit of a performance hit from my</div><div>> testing as well, as it's an expensive operation, and I guess we're now</div><div>> doing it twice.</div><div>></div><div>> So I think that could be improved so one can get a null out, or at</div><div>> least give us an idiom that isn't a performance drag.</div><div>></div><br><div>Using a sentinel value, like your NullObject, should be okay.</div><br><div>orElse(T) is specified to reject null to allow it be compatibly changed</div><div>to T! in the future.</div><br><div>-Alan</div></div></blockquote><img class="mailspring-open" alt="Sent from Mailspring" width="0" height="0" style="border:0; width:0; height:0;" src="https://link.getmailspring.com/open/B0C6DE23-FA2B-4B0A-A181-FFBD8DD5AAED@getmailspring.com?me=9c1fe37a&recipient=bG9vbS1kZXZAb3Blbmpkay5vcmc%3D">