Using a type parameter at the 'wrong' time?

I tried to make a subclass of SwingWorker using...

privateclass ProcessSAV<Void, String>extends SwingWorker{...}

...and in the doInBackground() method, I declared and initialized a local variable...

String filename ="blahblahblah";

Somehow, I manage to get an incompatible types compile-time error at this line of code.

found: java.lang.String

required: String

I know that the second type parameter is used to the specify the object type in publish() as well as the List type in process(). When I declare a String as the local variable in this instance, it seems to be a unique type related the second type argument and won't accept anything that returns a java.lang.String.

Why is it doing this? And is there any way to get around it?

[977 byte] By [RWonga] at [2007-11-26 14:49:56]
# 1

You created two type parameters having the names of classes, thus the String you refer to actually is a type parameter, not the String class.

You most probably wanted to do the following:private class ProcessSAV extends SwingWorker<Void, String> {...}

stefan.schulza at 2007-7-8 8:38:01 > top of Java-index,Core,Core APIs...
# 2
Ah, the magic of silly mistakes. Works perfectly now, thanks.
RWonga at 2007-7-8 8:38:02 > top of Java-index,Core,Core APIs...