[jboss-jira] [JBoss JIRA] (JGRP-2138) Request.viewChange() implementations should not use View.getMembers()

Dan Berindei (JIRA) issues at jboss.org
Tue Dec 6 13:23:00 EST 2016


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

Dan Berindei commented on JGRP-2138:
------------------------------------

I don't think the copying approach is really more efficient, especially for large views.

Considering that {{View}} also has a {{getMembersRaw()}} method that gives direct access to the members array, is it really that important that {{getMembers()}}'s return value cannot be used to modify the members array? If yes, considering that {{View}} objects are not created very often, I would suggest caching an {{UnmodifiableList}} in a field.

> Request.viewChange() implementations should not use View.getMembers()
> ---------------------------------------------------------------------
>
>                 Key: JGRP-2138
>                 URL: https://issues.jboss.org/browse/JGRP-2138
>             Project: JGroups
>          Issue Type: Bug
>            Reporter: Dan Berindei
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 3.6.12, 4.0
>
>
> {{Request.viewChange()}} is called once for every request, and {{View.getMembers()}} allocates 2 (small) objects. Both {{UnicastRequest}} and {{GroupRequest}} could use {{View.containsMember()}} instead.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list