Is this all the code needed to get this error? I saw something very similar in some code that I watched today. An additional parameter has been added to the equivalent of your Factory method, which also had a generic type. This lacked this general definition, and I believe that this was the reason that it was confusing the compiler.
those. if your Factory method looked something like
public class Factory { public static <E extends SomeInterface> E load( Class<E> class, Key key ) {
Where there is some Class class defined by something like this
public class Key<Datatype> { .... }
When providing something like this to call a method, donβt mark any generics of the ad declaration
Key key = new Key() MyObject obj = Factory.load( MyObject.class, key );
Hope this helps,
Robin source share