<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:small;color:#073763">David,</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:small;color:#073763"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:small;color:#073763">The code isn't quite the same as the working examples.  The broken one says "...size != 0" but the working examples say "size() != 0" (method call).</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:small;color:#073763"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:small;color:#073763">-Les</div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><br></div><div><table style="color:rgb(136,136,136);border:none;border-collapse:collapse"><tbody><tr style="height:0pt;border-top:1pt solid rgb(204,204,204)"><td style="border-right:1pt solid rgb(204,204,204);vertical-align:middle;padding:5pt;overflow:hidden"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><a href="http://www.carleton.edu/" target="_blank"><span style="font-size:11pt;font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:70px;height:73px"><img height="73" src="https://lh6.googleusercontent.com/QEL1To3Ci_dJA1huaKzfZ0Lf4MaZlAy_f-W3vQjbyzNq_yXq_ZYGv3tuT4dkaZS_bZ5X6fZR4iKzBboZhxbCF5htZFnLNKGqmrzHsVJtsjsy0pfK5w2z0Dlq-EtZcWhv0PxBpWmR" width="70" style="margin-left:0px;margin-top:0px"></span></span></a></p></td><td style="border-left:1pt solid rgb(204,204,204);vertical-align:top;padding:10.8pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><font color="#dea410" face="Arial"><span style="font-size:14.6667px;white-space:pre-wrap"><b>Les LaCroix '79</b></span></font></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="color:rgb(11,80,145)"><span style="font-size:11pt;font-family:Arial;vertical-align:baseline;white-space:pre-wrap">Strategic Technologist</span></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="color:rgb(11,80,145)"><span style="font-size:11pt;font-family:Arial;vertical-align:baseline;white-space:pre-wrap">Information Technology Services</span></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="color:rgb(11,80,145)"><span style="font-size:11pt;font-family:Arial;vertical-align:baseline;white-space:pre-wrap">t: (507) 222-5455</span></span></p></td></tr></tbody></table></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 25, 2022 at 1:31 PM IAM David Bantz via users <<a href="mailto:users@shibboleth.net">users@shibboleth.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>This little script (inside the EdReadyRole attribute definition) to add a default value if a dependent attribute did not assign value:<br></div><div><br></div><div><pre style="border:1px solid rgb(206,206,206);background-color:rgb(244,244,244);padding:10px;border-radius:2px;margin-top:0px;margin-bottom:0px">if (typeof EdReadyEntitlement != “undefined” && EdReadyEntitlement != null && EdReadyEntitlement.getValues().size !=0)<br>      {value = EdReadyEntitlement.getValues().get(0);<br>      EdReadyRole.addValue(value);}<br>    else<br>     {EdReadyRole.addValue(“Student”);}</pre></div><div><span style="color:rgb(29,28,29);font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;background-color:rgb(248,248,248)"><br></span></div><div dir="ltr"><span style="color:rgb(29,28,29);font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-variant-ligatures:common-ligatures;background-color:rgb(248,248,248);font-size:13px">triggers this error if the attribute EdReadyEntitlement is in fact empty:</span></div><div dir="ltr"><span style="color:rgb(29,28,29);font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;background-color:rgb(248,248,248)"><br></span></div><div dir="ltr"><span style="color:rgb(29,28,29);font-family:Slack-Lato,Slack-Fractions,appleLogo,sans-serif;font-size:15px;font-variant-ligatures:common-ligatures;background-color:rgb(248,248,248)"><pre style="box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace">'EdReadyRole':Script did not run successfully
        at net.shibboleth.idp.attribute.resolver.ad.impl.ScriptedAttributeDefinition$AttributeDefinitionScriptEvaluator.execute(ScriptedAttributeDefinition.java:228)
Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
</pre></span><div><br></div><div dir="ltr">A colleague smartly told me to replace .size() with .length, which does in fact work without triggering the error. I do not really understand why, given the existence of > 20 other instances of precisely parallel tests of non-existence of dependent attribute in my resolver, accumulated over many years. e.g.,</div><div dir="ltr"><br></div><div dir="ltr"><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">if (typeof uakStudentMAU != "undefined" && uakStudentMAU != null && uakStudentMAU.getValues().</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b>size()</b></span><span style="font-variant-ligatures:no-common-ligatures"> != 0)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"></span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">if (typeof mauPrimaryAffiliation != "undefined" && mauPrimaryAffiliation != null && mauPrimaryAffiliation.getValues().</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b>size()</b></span><span style="font-variant-ligatures:no-common-ligatures"> != 0)</span></p><p style="margin:0px;font-stretch:normal;line-height:normal" dir="ltr"><span style="font-variant-ligatures:no-common-ligatures;font-size:13px"><font face="ui-sans-serif, sans-serif">…</font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal" dir="ltr"><span style="font-variant-ligatures:no-common-ligatures;font-size:13px"><font face="ui-sans-serif, sans-serif"><br></font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal" dir="ltr"><font face="ui-sans-serif, sans-serif">Should I replace all the .size() with .length condition?</font></p><p style="margin:0px;font-stretch:normal;line-height:normal" dir="ltr"><span style="font-variant-ligatures:no-common-ligatures;font-size:13px"><font face="ui-sans-serif, sans-serif"><br></font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal" dir="ltr"><span style="font-variant-ligatures:no-common-ligatures;font-size:13px"><font face="ui-sans-serif, sans-serif"><i>Feel free to administer virtual dope slap if accompanied by good explanation!</i></font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal" dir="ltr"><span style="font-variant-ligatures:no-common-ligatures;font-size:13px"><font face="ui-sans-serif, sans-serif"><br></font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal" dir="ltr"><span style="font-variant-ligatures:no-common-ligatures;font-size:13px"><font face="ui-sans-serif, sans-serif">David St Pierre Bantz</font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal" dir="ltr"><span style="font-variant-ligatures:no-common-ligatures;font-size:13px"><font face="ui-sans-serif, sans-serif"><i><br></i></font></span></p></div></div></div>
-- <br>
For Consortium Member technical support, see <a href="https://shibboleth.atlassian.net/wiki/x/ZYEpPw" rel="noreferrer" target="_blank">https://shibboleth.atlassian.net/wiki/x/ZYEpPw</a><br>
To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net" target="_blank">users-unsubscribe@shibboleth.net</a><br>
</blockquote></div>