You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Josef <jo...@gmail.com> on 2010/08/04 13:39:16 UTC

Roles.clone

Hello.
Quite new to the wicket world, and reading through code on some
projects. So , excuse me for some beginners question farther on.

One thing i can't find is why would anyone do a clone like:

	@Override
	public Roles getRoles() {
		return (Roles) roles.clone();
	}

when writing your own Session (extends AuthenticatedWebSession )
Why is that?

Regards
JA

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Roles.clone

Posted by northar <jo...@gmail.com>.
Aha, so thats why they do the .clone.Thanks for the answer
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Roles-clone-tp2313319p2313988.html
Sent from the Wicket - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Roles.clone

Posted by Peter Ertl <pe...@gmx.org>.
getRoles() is considered to access the roles read-only so the caller only gets a non-critical copy of the internal roles collection.

Am 04.08.2010 um 13:39 schrieb Josef:

> Hello.
> Quite new to the wicket world, and reading through code on some
> projects. So , excuse me for some beginners question farther on.
> 
> One thing i can't find is why would anyone do a clone like:
> 
> 	@Override
> 	public Roles getRoles() {
> 		return (Roles) roles.clone();
> 	}
> 
> when writing your own Session (extends AuthenticatedWebSession )
> Why is that?
> 
> Regards
> JA
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org