Java generics name clash , has the same erasure

Viewed 50045

I have superclass Foo. And a class Bar extending it.

public class Bar extends Foo

Function in Foo:

protected void saveAll(Collection<?> many)

Function in Bar:

public void saveAll(Collection<MyClass> stuff) {
   super.saveAll(stuff);
}

Getting error :

 Name clash: The method saveAll(Collection<MyClass>) of type Bar has the same erasure as saveAll(Collection<?>) of type Foo but does not override it.

What am I doing wrong?

6 Answers
Related