[jboss-jira] [JBoss JIRA] Commented: (JGRP-1141) RspList: use generics

Bela Ban (JIRA) jira-events at lists.jboss.org
Thu Apr 21 04:39:33 EDT 2011


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

Bela Ban commented on JGRP-1141:
--------------------------------

The issue is that if we use generics, callers have to change
RspList rsps=disp.callXXX();
to
RspList<Object> rsps=...; // or the real type of the return value

The problem is that this doesn't add to type safety at compile time, e.g.

If we define RspList<Integer> rsps=disp.callRemoteMethods(...);
and get back a list of Strings, then
Integer val=rsps.getFirst(); // this will throw a ClassCastException



> RspList: use generics
> ---------------------
>
>                 Key: JGRP-1141
>                 URL: https://issues.jboss.org/browse/JGRP-1141
>             Project: JGroups
>          Issue Type: Task
>            Reporter: Bela Ban
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 3.0
>
>
> e.g. RspList<Integer> list=disp.callRemoteMethods(....);
> for(Rsp<Ineteger> rsp: rsps) {
>      int counter=rsp.getValue();
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list