<div dir="ltr"><div>Matej,</div><div><br></div><div>Since @Inject can only work with a qualifier annotation not anything other annotations, do you think adding a validation criteria to assert that is acceptable? <br></div><div>For IDE validation, it is quite limited because a lot of work needs to be done via runtime to figure out whether the 2nd annotation is a CDI qualifier or not. <br></div><div><br></div><div>Thanks</div><div>Emily<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 14, 2020 at 3:28 PM Benjamin Confino &lt;<a href="mailto:BENJAMIC@uk.ibm.com">BENJAMIC@uk.ibm.com</a>&gt; 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"><font size="2" face="sans-serif">Hello weld<br>
<br>
I had a customer with an issue that I believe occurred because they annotated
a field with both @Inject and @EJB. This has given me two questions: <br>
<br>
1) Should weld throw an error when a field is annotated with both annotations?
<br>
<br>
2) If so is the correct way to add something like </font>
<br>
<br><font size="2" face="sans-serif"> if (ij.getAnnotated().isAnnotationPresent(Inject.class)
&amp;&amp; ij.getAnnotated().isAnnotationPresent(EJB.class)) {</font>
<br><font size="2" face="sans-serif">    throw ...</font>
<br><font size="2" face="sans-serif">}</font>
<br>
<br><font size="2" face="sans-serif">to Validator.validateInjectionPointForDefinitionErrors()</font>
<br>
<br><font size="2" face="sans-serif">If so I&#39;m willing to create a pull request,
all I&#39;d need is for you to tell me what the error message should say and
please point me to which test I should expand to cover this case. <br>
<br>
Regards<br>
Benjamin<br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Thanks<br>Emily<br><br></div></div></div>