<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> 
        <base href="https://hibernate.atlassian.net"> 
        <title>Message Title</title> 
    </head> 
    <body class="jira" style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.429"> 
        <table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0" bgcolor="#f5f5f5"> 
            <!-- header here --> 
            <tbody>
                <tr> 
                    <td id="header-pattern-container" style="padding: 0; border-collapse: collapse; padding: 10px 20px"> 
                        <table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                            <tbody>
                                <tr> 
                                    <td id="header-avatar-image-container" valign="top" style="padding: 0; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px" width="32"> <img id="header-avatar-image" class="image_fix" src="https://avatar-cdn.atlassian.com/2af8dcfc97bd2deb53b77762ddeb3ccf?s=48&amp;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F2af8dcfc97bd2deb53b77762ddeb3ccf%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top"> </td> 
                                    <td id="header-text-container" valign="middle" style="padding: 0; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> <a class="user-hover" rel="abeani" id="email_abeani" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=abeani" style="color:#6c797f;; color: #3b73af; text-decoration: none">Andreas Benneke</a> <strong>commented</strong> on <a href="https://hibernate.atlassian.net/browse/HV-1602" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-db49a494-c6fa-48bd-a629-b1b707121d21" height="16" width="16" border="0" align="absmiddle" alt="Bug"> HV-1602</a> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="email-content-container" style="padding: 0; border-collapse: collapse; padding: 0 20px"> 
                        <table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; border-spacing: 0; border-collapse: separate"> 
                            <tbody>
                                <tr> 
                                    <!-- there needs to be content in the cell for it to render in some clients --> 
                                    <td class="email-content-rounded-top mobile-expand" style="padding: 0; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 15px; background-color: #ffffff; border-left: 1px solid #cccccc; border-top: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px; height: 10px; line-height: 10px; padding: 0 15px 0 16px; mso-line-height-rule: exactly" height="10" bgcolor="#ffffff">&nbsp;</td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> 
                                        <table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                            <tbody>
                                                <tr> 
                                                    <td style="vertical-align: top;; padding: 0; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" class="page-title-pattern-header-container"> <span class="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HV-1602" style="color: #3b73af; text-decoration: none">Re: Use index based validation based on implementation (instead of return value)</a> </span> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td id="text-paragraph-pattern-top" class="email-content-main mobile-expand  comment-top-pattern" style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; border-bottom: none; padding-bottom: 0" bgcolor="#ffffff"> 
                                        <table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
                                            <tbody>
                                                <tr> 
                                                    <td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0; border-collapse: collapse; padding: 0 0 10px"> <p style="margin: 10px 0 0; margin-top: 0">Thank you for your time, clarifying the wording, the explanations and the valuable performance hints.</p> <p style="margin: 10px 0 0">I understand your ideas on the optimizations – but I still think they are going one step too far. I’d like to come back to my thoughts on classes and interfaces with a few examples: </p> <p style="margin: 10px 0 0">When HV sees <tt>Optional</tt> as declared type it can safely exclude all other <tt>ValueExtrators</tt> (except the one for <tt>Optional</tt>) because none of them is compatible with <tt>Optional</tt> (<tt>Optional</tt> is not implementing any interface) and no subclass ever will (<tt>Optional</tt> it is final).</p> <p style="margin: 10px 0 0">My general rule of thumb here would be that this is the case for any <ins>final class</ins> as declared type.</p> <p style="margin: 10px 0 0">When HV sees <tt>ReadOnlyListProperty</tt> as declared type it can safely exclude any other <tt>ValueExtractor</tt> for <ins>classes</ins> not compatible with this class – like <tt>int[]</tt>, <tt>ReadOnlySetProperty</tt>, … However, it must not exclude the <tt>ValueExtractor</tt> for <tt>ListProperty</tt> as this is a “compatible” class (extending <tt>ReadOnlyListProperty</tt>) and the runtime type might be exactly this.</p> <p style="margin: 10px 0 0">IMHO it must also not exclude the <tt>ValueExtractor</tt> for <ins>any interface</ins> - because the runtime type might implement exactly such an interface. This means that in this example I would not want to rule out <tt>ValueExtractors</tt> for <tt>Iterable</tt>, <tt>List</tt>, <tt>Map</tt>, ...– just because it is technically possible for the runtime type to implement any of these interfaces. HV still has to decide based on the runtime type which is the “most specific” extractor – but excluding them in the first place does not reflect the possibilities of the language.<br> (Yes, I cannot think of any valuable implementation case with the given classes and interfaces – but since it is technically possible one might come up with a valid set of different classes/interfaces which would require support for this.) </p> <p style="margin: 10px 0 0">The same holds true for <tt>Iterable</tt>, <tt>List</tt>, <tt>Map</tt> as declared type: HV can safely exclude <tt>ValueExtractors</tt> for <tt>int[]</tt>, <tt>Object[]</tt>, <tt>Optional</tt>, <tt>OptionalInt</tt>, etc. as performance optimization just because these are <ins>final classes</ins> and not implementing the given interface. It is again impossible in this case for the runtime type to be any of those classes.</p> <p style="margin: 10px 0 0">IMHO it is again <ins>not</ins> valid to exclude <ins>any</ins> <tt>ValueExtractor</tt> for any <ins>interface</ins> if the declared type is a non-final class or interface. Just because you don’t know what interfaces a runtime subclass might implement.<br> (A valuable example here is our <tt>OrderedSet</tt>.)</p> <p style="margin: 10px 0 0">My general rule of thumb would be: If the declared type is a <ins>non-final class</ins> or <ins>interface</ins> HV can sort out <tt>ValueExtractors</tt> for incompatible <ins>classes</ins>. However <ins>all</ins> <tt>ValueExtractors</tt> for <ins>interfaces</ins> should remain possible.</p> <p style="margin: 10px 0 0">The nice/tricky thing with <tt>Set</tt> and <tt>List</tt> in our case is that <tt>List</tt> includes all <tt>Set</tt> methods just with a different semantics. Thus our <tt>OrderedSet</tt> can safely implement both interfaces.</p> <p style="margin: 10px 0 0">Yes, we could declare <tt>List</tt> or <tt>OrderedSet</tt> as return types to solve this (though this is not <em>that</em> easy because the given code is generated by Hibernate Tools). And yes, we could solve/work around this by adding our own <tt>OrderedSetValueExtractor</tt>. But as explained above I more have the feeling that HV is over-optimized here a bit.</p> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> <script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "EmailMessage",
  "description": "View Issue",
  "potentialAction": {
    "@type": "ViewAction",
        "target": "https://hibernate.atlassian.net/browse/HV-1602?inbox=true&focusedCommentId=102057&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-102057",
    "name": "View Comment"
      },
  "publisher": {
    "@type": "Organization",
    "name": "Atlassian",
    "url": "https://www.atlassian.com"
  }
}
</script> 
                                        <table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="actions-pattern-container" valign="middle" style="padding: 0; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0"> 
                                                        <table align="left" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                                            <tbody>
                                                                <tr> 
                                                                    <td class="actions-pattern-action-icon-container" style="padding: 0; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HV-1602#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none"> <img class="actions-pattern-action-icon-image" src="cid:jira-generated-image-static-comment-icon-eb2a9ca5-d108-4681-aa4d-e74f83eb711d" alt="Add Comment" title="Add Comment" height="16" width="16" border="0" style="vertical-align: middle"> </a> </td> 
                                                                    <td class="actions-pattern-action-text-container" style="padding: 0; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px"> <a href="https://hibernate.atlassian.net/browse/HV-1602#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> </td> 
                                                                </tr> 
                                                            </tbody>
                                                        </table> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <!-- there needs to be content in the cell for it to render in some clients --> 
                                <tr> 
                                    <td class="email-content-rounded-bottom mobile-expand" style="padding: 0; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #ffffff; border-top: 0; border-left: 1px solid #cccccc; border-bottom: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly" height="5" bgcolor="#ffffff">&nbsp;</td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="footer-pattern" style="padding: 0; border-collapse: collapse; padding: 12px 20px"> 
                        <table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                            <tbody>
                                <tr> 
                                    <td id="footer-pattern-mobile-separated-links" class="mobile-resize-text" width="100%" colspan="2" style="padding: 0; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> Get Jira notifications on your phone! Download the Jira Cloud app for <a href="https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&amp;referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail" style="color: #3b73af; text-decoration: none">Android</a> or <a href="https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&amp;ct=EmailNotificationLink&amp;mt=8" style="color: #3b73af; text-decoration: none">iOS</a> 
                                        <hr> </td> 
                                </tr> 
                                <tr> 
                                    <td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> This message was sent by Atlassian Jira <span id="footer-build-information">(v1001.0.0-SNAPSHOT#100083-<span title="894add098b3de1ca5a14161fcb2ebf324e5e5c58" data-commit-id="894add098b3de1ca5a14161fcb2ebf324e5e5c58}">sha1:894add0</span>)</span> </td> 
                                    <td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0; border-collapse: collapse; padding-left: 20px; vertical-align: top"> 
                                        <table style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="footer-pattern-logo-desktop-padding" style="padding: 0; border-collapse: collapse; padding-top: 3px; opacity: 0.150"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-a5b92eb1-19ed-4c95-b0f8-bb07a166e39f" alt="Atlassian logo" title="Atlassian logo" width="192" height="24" class="image_fix"> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
            </tbody>
        </table>   
    
<img src="https://u4043402.ct.sendgrid.net/wf/open?upn=YNXLe5Uzuivj8jGpuXra04BSJ-2BS7raa1puTAtyVUP-2F0UG25sB-2BHToWWBMcbXwnNUejhainO0faGS2QtIRXLauIk3uIrS-2BqK-2B7DQStOi47x3p8v24JbxT4LLaHR0qibnpizMt8DpU471P2QKCY5LtOLxImMzxmB-2BKEG8D2ajQ6yEjq7rKAvfMfiZUfw-2BOQdVQTD-2FoQI2aLaKZ-2FPPIdfI8Uf-2FlUfCIfjBB1GLDVOHzZ7kbOvoZuRZd9vghXwljLwWkmcIAaNHX4MEev9o75qi4Jt9sKInCU3MIM3sExMVE4FtDDiW8c2MZdPF0aAV2vR6ipPgfaPTxl2PR2ekU-2FwS-2Fmke3HKDh-2FyXRQPAnk5s1R-2FWCd4m3-2FQV5KQFW7fL009Ou6eVbUJISkPUPF4PIa8VyweFbgPBeMIehCv802g3MSv71m5NxhdIJSu5JIDzuzAAqKGOAYXwSZ7o-2FdvvBhJpbIQ-3D-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body>
</html>