<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I've been doing more experimenting with this API and ran across a minor issue. The way the stack map generator API is presently structured, it seems difficult to "get-or-generate".</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">For example, I thought to find the stack map for a method, or otherwise generate it if it did not exist, so my code looked something like this (structured for readability):</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">  Â  MethodModel mm = ....;</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">  Â  Optional<StackMapAttribute> optAttr = mm.findAttribute(Attributes.STACK_MAP_TABLE);</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">  Â  StackMapAttribute sma = optAttr.orElseGet(() -> new StackMapGenerator(...).stackMapTableAttribute());</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">But this fails because `StackMapGenerator.stackMapTableAttribute()` returns an `Attribute<? extends StackMapAttribute>` instead of just `StackMapAttribute`. This method returns an anonymous subclass of `AdHocAttribute`; could it instead be changed to an inner class which also implements `StackMapAttribute`? I think this might be more correct as well because the type argument of `Attribute` seems like it was intended to be a self-type, and if so, these direct anonymous subclasses (and there are a few of them) seem to violate that intention.</div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">- DML â€¢ he/him<br></div></div></div>