[jboss-jira] [JBoss JIRA] (JGRP-1688) Generic type in Executions

shen kim (JIRA) jira-events at lists.jboss.org
Fri Sep 6 23:18:03 EDT 2013


    [ https://issues.jboss.org/browse/JGRP-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802542#comment-12802542 ] 

shen kim commented on JGRP-1688:
--------------------------------

For Example:
I declared Callable implement like this:
public class CustomerCallback implements Callable<String> { ... }
Then, I used it in following step:
1,ExecutionCompletionService<String> execService = new ExecutionCompletionService<String>(new ExecutionService(this.channel));
2,Class<CustomerCallback> clazz =  CustomerCallback.class;
3,Constructor<CustomerCallback> cc = clazz.getConstructor(new Class[]{});
4,execService.submit(Executions.serializableCallable(cc, new Object[]{}));
In step 4, the IDE would tip me:
The method submit(Callable<String>) in the type ExecutionCompletionService<String> is not applicable for the arguments (Callable<capture#1-of ?>)
                
> Generic type in Executions
> --------------------------
>
>                 Key: JGRP-1688
>                 URL: https://issues.jboss.org/browse/JGRP-1688
>             Project: JGroups
>          Issue Type: Bug
>            Reporter: shen kim
>            Assignee: Bela Ban
>
> Following this method:
> static Callable<?> serializableCallable(Constructor<? extends Callable> constructorToUse, java.lang.Object... args)
> Assume one object extends Callable as MyCallable, so the symbol (\?) will replace with MyCallable, and the result object Callable<MyCallable> maybe something wrong?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list