<p dir="ltr">Thank you for your response Brian. Very informative, I appreciate it. You definitely read my intent.</p>
<p dir="ltr">I now agree, keeping the border where it is makes the most sense. There are other ways to achieve what I want, so I will go with those for now. And like you mentioned, feasability aside, this will wreck people's mental model. Cutting it short makes things significantly easier and cleaner.</p>
<p dir="ltr">And thank you for your response Archie. I was more speaking to annotations that only support String values. The vast majority of annotations seem to fall under that case, including the one I want to work with. I understand that it is not the strongest argument, which is why I just wanted to see the downsides of the idea.</p>
<p dir="ltr">As for your idea, I quite like it. No idea about the viability though.</p>
<br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 17, 2024, 12:01 PM Brian Goetz <<a href="mailto:brian.goetz@oracle.com">brian.goetz@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

  
  <div>
    <font size="4" face="monospace">Yes, this is a frequent request. 
      And our analysis of this remains: it is reasonable from a
      linguistic point of view, but the implementation is hellaciously
      intrusive (as it cuts through all the layers mentioned), and so
      ends up having a relatively poor return-on-investment compared to
      other improvements.</font><br>
    <br>
    <br>
    <div>On 10/17/2024 11:08 AM, Kasper Nielsen
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div>
        <div>Hi,
          I know this feature has been requested a number of times. But
          I want to add one more usecase.
          There is common pattern in many frameworks of specifying a
          factory class in an annotation <a href="http://a.la" target="_blank" rel="noreferrer">a.la</a>. </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"> @SomeFrameworkAnnotation(factory =
          MyAppFactory.class)</div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">Unfortunately, this pattern requires some more
          effort, if you want to use it together with modules.
          Either you need to open the package or handoff a Lookup object
          to the framework in some way.
          While this isn't super complicated, it would ease the on-ramp
          if you could simply use </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"> @SomeFrameworkAnnotation(factory =
          MyAppFactory::new) </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"> I know this type of "annotation programming"
          aren't really used in the JDK, but in Java's wider ecosystem I
          see it a lot. </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"> Best, Kasper</div>
        <br>
      </div>
      <div>
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
            <div dir="ltr">
              <div class="gmail_quote">
                <div><br>
                </div>
                <div>Idea: What about allowing lambda values for
                  Class-valued annotation properties when the Class is a
                  functional interface?</div>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div>