<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div>With this just remember that there can be &gt;1 WeldClass per real class!<br></div></blockquote><div><br></div><div>Sure, but I think we shouldn't wrap existing WeldClass impls -- else we end-up with dups.</div><div>(unless we then properly impl equals/hash, which is a pita in this case ...)</div><div><br></div><div>I've added this to ClassTransformer:</div><div><br></div><div><div>&nbsp; &nbsp; public &lt;T&gt; WeldClass&lt;T&gt; loadClass(final AnnotatedType&lt;T&gt; clazz) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // don't wrap existing weld class, dup instances!</div><div>&nbsp; &nbsp; &nbsp; &nbsp;if (clazz instanceof WeldClass) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return (WeldClass&lt;T&gt;) clazz;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } else if (clazz instanceof ForwardingAnnotatedType &amp;&amp; ((ForwardingAnnotatedType) clazz).delegate() instanceof WeldClass) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ForwardingAnnotatedType fat = (ForwardingAnnotatedType) clazz;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return (WeldClass&lt;T&gt;) fat.delegate();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } else {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return (WeldClass&lt;T&gt;) annotatedTypes.get(clazz);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div><br></div></div><div><br></div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font><blockquote type="cite">"Bar extends Foo"<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The problem is that both Bar and Foo are added as AnnotatedType against ClassTransformer,<br></blockquote><blockquote type="cite">and eventually deployed as such.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">But WeldClassImpl::superclass is looked-up against ClassTransformer::classes --&gt; diff WC_Foo instances<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">ClassTransformer<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;private final ConcurrentMap&lt;TypeHolder&lt;?&gt;, WeldClass&lt;?&gt;&gt; classes;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;private final ConcurrentMap&lt;AnnotatedType&lt;?&gt;, WeldClass&lt;?&gt;&gt; annotatedTypes;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">... and no equals/hash impl on WeldClassImpl ...<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">WELD-802 is due to WeldClassImpl not being the same for same class:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">        </span>• clazz = {java.lang.Class@5703}"class org.jboss.weld.tests.specialization.weld802.Foo"<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">        </span>• weldClass = {org.jboss.weld.introspector.jlr.WeldClassImpl@5687}"public@RequestScoped class org.jboss.weld.tests.specialization.weld802.Foo" <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">--<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">        </span>• key: org.jboss.weld.introspector.jlr.WeldClassImpl = {org.jboss.weld.introspector.jlr.WeldClassImpl@5709}"public@RequestScoped class org.jboss.weld.tests.specialization.weld802.Foo"<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">        </span>• value: org.jboss.weld.bean.ManagedBean = {org.jboss.weld.bean.ManagedBean@5961}"Managed Bean [class org.jboss.weld.tests.specialization.weld802.Foo] with qualifiers [@Any @Default]" <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">... investigating further ...<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">weld-dev mailing list<br></blockquote><blockquote type="cite"><a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br></blockquote><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/weld-dev">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br></blockquote><br></div></blockquote></div><br></body></html>