You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Davanum Srinivas <da...@gmail.com> on 2007/06/19 03:37:27 UTC

Re: [axis2] Re: svn commit: r547926 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/rpc/receivers/ kernel/src/org/apache/axis2/ kernel/src/org/apache/axis2/addressing/ kernel/src/org/apache/axis2/context/ kernel/src/org/apache/ax

Glen,

Can we wrap it around an unModifieableList call?

http://java.sun.com/j2se/1.3/docs/api/java/util/Collections.html#unmodifiableList(java.util.List)

thanks,
dims

On 6/18/07, Glen Daniels <gl...@thoughtcraft.com> wrote:
> Hi Thilina!
>
> Thilina Gunarathne wrote:
> > Hi Glen,
> >> Author: gdaniels
> >> Date: Sat Jun 16 07:21:09 2007
> >> New Revision: 547926
> >>
> >> -    public List getGlobalModules() {
> >> -        return globalModuleList;
> > Looks like you forgot  the @deprecated keyword..
> >
> > IMHO it would have been better if you *atleast* deprecate this, rather
> > than removing this...
>
> +1.  The problem with the method (as with many methods in
> AxisConfiguration, as it turns out) is that it was returning a mutable
> list.  This means other code aside from AxisConfiguration could add and
> delete things from the list, and those modifications may not keep to the
> invariants the class implies (i.e. don't add an Integer to a list of
> AxisModules).  Also multiple threads could keep references to the list
> and therefore put it into an inconsistent state.  Far better for the
> interface to protect against that kind of thing, which is why I added
> addGlobalModule(AxisModule) and removed getGlobalModules().  Sorry I did
> it a little swiftly.
>
> How about if I put it back, but return a cloned copy of the list so
> modifying it does NOT affect the underlying AxisConfiguration?
>
> We might also want to fix this up for the other lists we return (out
> phases, etc).
>
> --Glen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org