The point is that theoretically you can have a similar bean:
interface Baz { |
void ping(); |
} |
@ApplicationScoped |
class Foo implements Baz {} |
public final String badMethod() {}; // Makes it unproxyable |
public void ping() {}; |
}
|
This bean has bean types: Foo and Baz. However, the following use case should work:
class Service { |
@Inject |
Baz baz; // Inject client proxy for Foo bean instance |
void doSomething() { |
baz.ping(); |
} |
}
|
See also https://github.com/weld/core/blob/master/tests-arquillian/src/test/java/org/jboss/weld/tests/scope/unproxyable/method/PublicFinalMethodInjectViaInterfaceTypeTest.java#L55. That is the reason why only injection points should be validated and not all the bean types of a bean. |