I've heavily simplified my problem. Here's how it reads.
I'm trying to figure out why the following code does not compile:
List<AnonType<AnonType<?>>> l = new ArrayList<AnonType<AnonType<?>>>();
l.add( new AnonType<AnonType<String>>() );
where
public class AnonType<T> {
T a;
List<T> b;
}
The compiler error is saying that add is not applicable for the argument given. OTOH, the following code with only 1-level nested wildcard compiles perfectly:
List<AnonType<?>> l = new ArrayList<AnonType<?>>();
l.add( new AnonType<String>() );