문제

I'm getting this warning while compling my code (with -Xlint options):

receptor.java:286: warning: [unchecked] unchecked call to 
FutureTask(java.util.concurrent.Callable<V>) as a member 
of the raw type java.util.concurrent.FutureTask

The line that generates the warning:

FutureTask task = new FutureTask (new Return(address, lock));

And the Return class implements Callable:

public class Return implements Callable <String> {

How can I fix the warning?

도움이 되었습니까?

해결책

According to the FutureTask documentation, this class is a generic class as well. This means you'll need

FutureTask<String> task = new FutureTask<String>(new Return(address, lock));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top