Tomasz Krakowiak Athough it's not 100% clear from the spec (it's arguable what contains exactly means) I believe that nested wildcards are forbidden too, i.e. List<Optional<?>> is not a legal bean type either.
See also the "3.3. Producer methods":
If a producer method return type contains a wildcard type parameter or is an array type whose component type contains a wildcard type parameter, the container automatically detects the problem and treats it as a definition error.
|